Skip to content

Commit 5cac6a9

Browse files
committed
add css for monaco & codemirror editors
1 parent 37c2235 commit 5cac6a9

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

blog/gists/user-styles.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,107 @@ nav_order: 2
99

1010
Custom user-defined style sheets to better browse the web.
1111

12+
## Monaco & CodeMirror editors
13+
14+
```css
15+
/* fixes offset cursor in editor */
16+
.monaco-editor .view-lines .view-line, .cm-line {
17+
/* for iosevka: editor font size * 1.10138462 */
18+
font-size: 110.138462% !important;
19+
font-family: Iosevka !important;
20+
font-feature-settings: "liga" 0;
21+
}
22+
23+
code, pre, .tio-markdown_code, [id^="file"], .file-info, .CodeMirror-linenumber, #copilot-button-positioner, .cm-gutterElement {
24+
font-family: Iosevka !important;
25+
font-feature-settings: "liga" 0;
26+
}
27+
28+
/* remove horrendous dots in coderpad */
29+
.monaco-editor .mtkw {
30+
color: #0000 !important
31+
}
32+
33+
/* cursor */
34+
.cursor.monaco-mouse-cursor-text,
35+
.cm-cursor.cm-cursor-primary
36+
{
37+
background-color: #e9b6c5bf !important;
38+
border-color: #e9b6c5bf !important;
39+
}
40+
41+
/* colors */
42+
43+
:root {
44+
--comment-green: #6a9955;
45+
--comment-steel-blue: rgb(97, 124, 149) !important;
46+
--keyword-pink: #c586c0;
47+
--keyword-lilac: rgb(177, 135, 232);
48+
}
49+
50+
/* matching bracket colors */
51+
52+
.view-line .mtk3 {
53+
color: var(--comment-steel-blue);
54+
}
55+
56+
.bracket-highlighting-0, .bracket-highlighting-3, .bracket-highlighting-6, .bracket-highlighting-9, .bracket-highlighting-12, .bracket-highlighting-15, .bracket-highlighting-18 {
57+
color: #ffd700a6 !important
58+
}
59+
60+
.view-line .mtk13, .mtk9.bracket-highlighting-1, .bracket-highlighting-4, .bracket-highlighting-7, .bracket-highlighting-10, .bracket-highlighting-13, .bracket-highlighting-16, .bracket-highlighting-19 {
61+
color: var(--keyword-pink) !important;
62+
}
63+
64+
.bracket-highlighting-2, .bracket-highlighting-5, .bracket-highlighting-8, .bracket-highlighting-11, .bracket-highlighting-14, .bracket-highlighting-17, .bracket-highlighting-20 {
65+
color: cornflowerblue !important;
66+
}
67+
68+
/* colors */
69+
70+
div.CodeMirror span.CodeMirror-matchingbracket {
71+
color: rgb(115, 176, 112);
72+
}
73+
74+
.cm-s-textmate span.cm-property {
75+
color: rgba(219, 210, 198, .89);
76+
}
77+
78+
.cm-s-textmate span.cm-def {
79+
color: rgb(122, 158, 208);
80+
}
81+
82+
.cm-s-textmate span.cm-keyword {
83+
color: #b187e8;
84+
}
85+
86+
.cm-s-textmate span.cm-variable-2 {
87+
color: rgb(140, 190, 198);
88+
}
89+
90+
.cm-s-textmate span.cm-comment {
91+
color: rgb(97, 124, 149);
92+
}
93+
94+
.cm-s-textmate span.cm-operator {
95+
color: rgb(86, 166, 114);
96+
}
97+
98+
.cm-s-textmate span.cm-number {
99+
color: rgb(90, 185, 196);
100+
}
101+
102+
.view-lines {
103+
/* softer colors */
104+
filter: saturate(0.7) brightness(1) sepia(0.1);
105+
}
106+
107+
.tio-markdown_img {
108+
filter: invert(.894) hue-rotate(177deg);
109+
opacity: .67;
110+
}
111+
```
112+
12113
## Light Themes & Printing
13114

14115

0 commit comments

Comments
 (0)