Skip to content

Commit 89eff51

Browse files
authored
fix(compass-editor): use semitransparent color for active line background color (#3940)
1 parent 00cd643 commit 89eff51

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-editor/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"@mongodb-js/compass-components": "^1.4.0",
7676
"@mongodb-js/mongodb-constants": "^0.1.5",
7777
"ace-builds": "^1.11.2",
78+
"polished": "^4.2.2",
7879
"react": "^16.14.0",
7980
"react-ace": "^9.5.0",
8081
"semver": "^7.3.8"

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import { Compartment, EditorState } from '@codemirror/state';
6464
import type { LanguageSupport } from '@codemirror/language';
6565
import { syntaxHighlighting, HighlightStyle } from '@codemirror/language';
6666
import { tags as t } from '@lezer/highlight';
67+
import { rgba } from 'polished';
6768

6869
const editorStyle = css({
6970
fontSize: 13,
@@ -78,10 +79,11 @@ const editorPalette = {
7879
backgroundColor: codePalette.light[0],
7980
gutterColor: palette.gray.base,
8081
gutterBackgroundColor: palette.gray.light3,
81-
gutterActiveLineBackgroundColor: palette.gray.light2,
82+
gutterActiveLineBackgroundColor: rgba(palette.gray.light2, 0.5),
8283
gutterFoldButtonColor: palette.black,
8384
cursorColor: palette.gray.base,
84-
activeLineBackgroundColor: palette.gray.light2,
85+
// Semi-transparent opacity so that the selection background can still be seen.
86+
activeLineBackgroundColor: rgba(palette.gray.light2, 0.5),
8587
selectionBackgroundColor: palette.blue.light2,
8688
bracketBorderColor: palette.gray.light1,
8789
},
@@ -90,10 +92,11 @@ const editorPalette = {
9092
backgroundColor: codePalette.dark[0],
9193
gutterColor: palette.gray.light3,
9294
gutterBackgroundColor: palette.gray.dark3,
93-
gutterActiveLineBackgroundColor: palette.gray.dark2,
95+
gutterActiveLineBackgroundColor: rgba(palette.gray.dark2, 0.5),
9496
gutterFoldButtonColor: palette.white,
9597
cursorColor: palette.green.base,
96-
activeLineBackgroundColor: palette.gray.dark2,
98+
// Semi-transparent opacity so that the selection background can still be seen.
99+
activeLineBackgroundColor: rgba(palette.gray.dark2, 0.5),
97100
selectionBackgroundColor: palette.gray.dark1,
98101
bracketBorderColor: palette.gray.light1,
99102
},

0 commit comments

Comments
 (0)