Skip to content

Commit 7c1561f

Browse files
committed
fix(webapp): code editors only highlight the active line while focused
An unfocused editor kept the resting cursor's line highlighted, which reads as a gray bar across the top of the query editor on page load.
1 parent cc03dfb commit 7c1561f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/webapp/app/components/code/codeMirrorTheme.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export function darkTheme(): Extension {
8484
backgroundColor: "var(--color-editor-search-match-selected)",
8585
},
8686

87-
".cm-activeLine": { backgroundColor: highlightBackground },
87+
// Only highlight the active line while the editor has focus - on an
88+
// unfocused editor the resting cursor paints a phantom gray bar
89+
".cm-activeLine": { backgroundColor: "transparent" },
90+
"&.cm-focused .cm-activeLine": { backgroundColor: highlightBackground },
8891
".cm-selectionMatch": { backgroundColor: "var(--color-editor-selection-match)" },
8992

9093
"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket": {
@@ -99,6 +102,9 @@ export function darkTheme(): Extension {
99102
},
100103

101104
".cm-activeLineGutter": {
105+
backgroundColor: "transparent",
106+
},
107+
"&.cm-focused .cm-activeLineGutter": {
102108
backgroundColor: highlightBackground,
103109
},
104110

0 commit comments

Comments
 (0)