Skip to content

Commit 58b07e3

Browse files
authored
fix(compass-editors): editor darkmode background selection color COMPASS-6910 (#4519)
1 parent 0a85002 commit 58b07e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/compass-editor/src/json-editor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const editorPalette = {
149149
cursorColor: palette.green.base,
150150
// Semi-transparent opacity so that the selection background can still be seen.
151151
activeLineBackgroundColor: rgba(palette.gray.dark2, 0.5),
152-
selectionBackgroundColor: palette.gray.dark1,
152+
selectionBackgroundColor: palette.gray.dark2,
153153
bracketBorderColor: palette.gray.light1,
154154
infoGutterIconColor: encodeURIComponent(palette.blue.light1),
155155
warningGutterIconColor: encodeURIComponent(palette.yellow.light2),
@@ -247,6 +247,9 @@ function getStylesForTheme(theme: CodemirrorThemeType) {
247247
'& .cm-selectionBackground': {
248248
backgroundColor: editorPalette[theme].selectionBackgroundColor,
249249
},
250+
'&.cm-focused .cm-selectionBackground, ::selection': {
251+
backgroundColor: editorPalette[theme].selectionBackgroundColor,
252+
},
250253
'&.cm-focused .cm-matchingBracket': {
251254
background: 'none',
252255
boxShadow: `0 0 0 1px ${editorPalette[theme].bracketBorderColor}`,

0 commit comments

Comments
 (0)