Skip to content

Commit

Permalink
Use a background instead of a :before element for highlighted spaces
Browse files Browse the repository at this point in the history
FIX: Improve performance of documents displaying lots of highlighted spaces
by using a CSS background instead of pseudo-element.

Issue codemirror/dev#1445
  • Loading branch information
marijnh committed Sep 25, 2024
1 parent aea2395 commit 605fd72
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ export const baseTheme = buildTheme("." + baseThemeID, {
verticalAlign: "top",
},

".cm-highlightSpace:before": {
content: '"·"',
position: "absolute",
pointerEvents: "none",
color: "#888"
".cm-highlightSpace": {
backgroundImage: "radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",
backgroundPosition: "center",
},

".cm-highlightTab": {
Expand Down

0 comments on commit 605fd72

Please sign in to comment.