Skip to content

Commit 31c1b19

Browse files
authored
fix: do not partially hide CM selection background on active lines (#82)
1 parent 89a913c commit 31c1b19

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/App.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,11 @@
126126
.cm-tooltip.cm-tooltip-autocomplete > ul {
127127
border-radius: 0.125rem;
128128
}
129+
130+
.cm-editor:not(:has(.cm-selectionBackground)) .cm-activeLine {
131+
background-color: hsl(var(--accent));
132+
}
133+
134+
.cm-editor:has(.cm-selectionBackground) .cm-activeLine {
135+
background-color: transparent;
136+
}

src/utils/codemirror-themes.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ESLintPlaygroundTheme = EditorView.theme(
1717
paddingRight: "1px",
1818
backgroundColor: "var(--body-background-color)",
1919
},
20-
".cm-activeLine, .cm-activeLineGutter": {
20+
".cm-activeLineGutter": {
2121
backgroundColor: "var(--body-background-color)",
2222
},
2323
".cm-content": {
@@ -53,7 +53,6 @@ export const ESLintPlaygroundTheme = EditorView.theme(
5353
margin: "0",
5454
},
5555
"&.cm-editor .cm-content .cm-line ::selection": {
56-
backgroundColor: "var(--color-primary-800) !important",
5756
color: "#fff !important",
5857
},
5958
},

0 commit comments

Comments
 (0)