Skip to content

Commit 098aab3

Browse files
committed
fix(sql): theme editor selection background and text for readable contrast
1 parent d461826 commit 098aab3

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

frontend/src/components/pages/sql/sql-editor.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,16 @@ function editorChrome(mode: 'light' | 'dark'): Extension {
130130
lineHeight: '21px',
131131
},
132132
'.cm-content': { padding: '12px 0' },
133-
// A global `[data-sidebar] *::selection` rule recolours selected text
134-
// white; keep each token's own colour through the selection instead. This
135-
// theme is unlayered, so it wins over the registry's @layer base rules.
136-
'.cm-content ::selection': { color: 'inherit' },
133+
// Selection: a global `[data-sidebar] *::selection` rule recolours the
134+
// text white on a washed background — unreadable. Theme both to the
135+
// registry's selection pair. The base theme's focused-selection rule is
136+
// high-specificity, so match its full path; this theme loads after the
137+
// base theme, so equal specificity wins on order alone. The text colour
138+
// is unlayered, so it beats the @layer base `::selection` rule.
139+
'& .cm-selectionBackground, &.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground': {
140+
backgroundColor: 'var(--color-selection)',
141+
},
142+
'.cm-content ::selection': { color: 'var(--color-selection-foreground)' },
137143
'.cm-gutters': { backgroundColor: 'transparent', border: 'none', color: 'var(--color-muted-foreground)' },
138144
'.cm-activeLineGutter': { backgroundColor: 'transparent', color: 'var(--color-foreground)' },
139145
'.cm-activeLine': { backgroundColor: 'var(--color-surface-default-hover)' },

0 commit comments

Comments
 (0)