Skip to content

Commit b67a6e8

Browse files
committed
Allow theme-sensitive styling of gutter markers
Using the CodeMirror-guttermarker and CodeMirror-guttermarker-subtle CSS classes to give the markers their color. Issue #2602
1 parent 4def0b2 commit b67a6e8

27 files changed

+62
-3
lines changed

addon/fold/foldgutter.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
}
1111
.CodeMirror-foldgutter-open,
1212
.CodeMirror-foldgutter-folded {
13-
color: #555;
1413
cursor: pointer;
1514
}
1615
.CodeMirror-foldgutter-open:after {

addon/fold/foldgutter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
function marker(spec) {
5959
if (typeof spec == "string") {
6060
var elt = document.createElement("div");
61-
elt.className = spec;
61+
elt.className = spec + " CodeMirror-guttermarker-subtle";
6262
return elt;
6363
} else {
6464
return spec.cloneNode(true);

lib/codemirror.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
box-sizing: content-box;
4141
}
4242

43+
.CodeMirror-guttermarker { color: black; }
44+
.CodeMirror-guttermarker-subtle { color: #999; }
45+
4346
/* CURSOR */
4447

4548
.CodeMirror div.CodeMirror-cursor {
@@ -86,6 +89,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
8689
border-left: 1px solid #ccc;
8790
position: absolute;
8891
}
92+
8993
/* DEFAULT THEME */
9094

9195
.cm-s-default .cm-keyword {color: #708;}
@@ -121,6 +125,8 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
121125
.cm-s-default .cm-error {color: #f00;}
122126
.cm-invalidchar {color: #f00;}
123127

128+
/* Default styles for common addons */
129+
124130
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
125131
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
126132
.CodeMirror-activeline-background {background: #e8f2ff;}

theme/3024-day.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010

1111
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
1212
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
13+
1314
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
15+
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }
16+
.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; }
1417
.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
18+
1519
.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
1620

1721
.cm-s-3024-day span.cm-comment {color: #cdab53;}

theme/3024-night.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
1212
.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
1313
.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
14+
.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; }
15+
.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; }
1416
.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;}
17+
1518
.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;}
1619

1720
.cm-s-3024-night span.cm-comment {color: #cdab53;}

theme/ambiance.css

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theme/base16-dark.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
1212
.cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;}
1313
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
14+
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
15+
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }
1416
.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}
1517
.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}
1618

theme/base16-light.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
1212
.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
1313
.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
14+
.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; }
15+
.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; }
1416
.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;}
1517
.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;}
1618

theme/blackboard.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
44
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
55
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
6+
.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
7+
.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }
68
.cm-s-blackboard .CodeMirror-linenumber { color: #888; }
79
.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
810

theme/cobalt.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.cm-s-cobalt.CodeMirror { background: #002240; color: white; }
22
.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
33
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
4+
.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; }
5+
.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
46
.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
57
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
68

0 commit comments

Comments
 (0)