From a17e84b61feac70cf11ff5b54e4f3daa32993e20 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 21 May 2024 13:43:56 -0400 Subject: [PATCH] chore: tooltip tweaks (#11716) * chore: tooltip tweaks * fix tooltip background * light/dark mode fix --- sites/svelte-5-preview/src/lib/CodeMirror.svelte | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sites/svelte-5-preview/src/lib/CodeMirror.svelte b/sites/svelte-5-preview/src/lib/CodeMirror.svelte index 9abde98261..38b89a9aa9 100644 --- a/sites/svelte-5-preview/src/lib/CodeMirror.svelte +++ b/sites/svelte-5-preview/src/lib/CodeMirror.svelte @@ -286,25 +286,26 @@ .cm-tooltip { border: none; - background-color: transparent; + background: var(--sk-back-3); font-family: var(--sk-font); max-width: calc(100vw - 10em); position: relative; + filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1)); } .cm-tooltip-section { position: relative; padding: 0.5em; - /* width: calc(100vw - 10em); */ - filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1)); + left: -13px; background: var(--bg); border-radius: 2px; + max-width: 64em; } .cm-tooltip-section::before { content: ''; position: absolute; - left: 20px; + left: 10px; width: 8px; height: 8px; transform: rotate(45deg); @@ -328,6 +329,10 @@ bottom: -4px; } + .cm-tooltip:has(.cm-diagnostic) { + background: transparent; + } + .cm-tooltip:has(.cm-diagnostic-warning) { --bg: var(--warning); --fg: #222;