Skip to content

Commit d9ab9a1

Browse files
committed
Rework syntax highlight to use fewer colors
1 parent 3ce352a commit d9ab9a1

File tree

1 file changed

+36
-48
lines changed

1 file changed

+36
-48
lines changed

_sass/base/_syntax_highlighting.scss

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,67 @@
1010
font-family: $fontMonoItalic;
1111
}
1212

13+
// foreground
14+
.highlight :is(.g, .l, .no, .nd, .nx, .w, .nn, .n, .vg),
15+
// properties, e.g. SET **threads** = 8;
16+
.highlight :is(.py),
17+
// class names
18+
.highlight :is(.nc, .nv, .nl),
19+
// punctuation
20+
.highlight :is(.p, .x),
21+
// operators
22+
.highlight :is(.o, .ow)
23+
{
24+
color: #383a42;
25+
}
26+
1327
// keywords
14-
.highlight :is(.k, .kc, .kd, .kn, .kr, .kt, .kv){
28+
.highlight :is(.k, .kc, .kd, .kn, .kr, .kt, .kv),
29+
// type names
30+
.highlight :is(.nb, .bp, .vcb)
31+
{
1532
color: #0098dd;
1633
font-family: $fontMonoBold;
1734
}
1835

19-
// properties
20-
.highlight :is(.py){
21-
color: #976F4D;
22-
}
23-
2436
// numbers
25-
.highlight :is(.m, .mf, .mh, .mi, .mo, .il){
37+
.highlight :is(.m, .mf, .mh, .mi, .mo, .il)
38+
{
2639
color: #ce33c0;
2740
}
2841

29-
// foreground
30-
.highlight :is(.g, .l, .no, .nd, .nx, .w, .nn, .n, .vg){
31-
color: #383a42;
42+
// functions
43+
.highlight :is(.nf, .nt, .na)
44+
{
45+
color: #23974a;
46+
font-family: $fontMonoBold;
3247
}
3348

34-
// type names
35-
.highlight :is(.nb, .bp, .vcb){
36-
color: #0098dd;
37-
font-family: $fontMonoBold;
49+
// strings
50+
.highlight :is(.ld, .s, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .dl)
51+
{
52+
color: #c5a332;
3853
}
3954

40-
// functions
41-
.highlight :is(.nf, .nt, .na){
42-
color: #23974a;
55+
// prompt
56+
.highlight :is(.gp){
57+
color: #E15300;
4358
font-family: $fontMonoBold;
4459
}
4560

46-
// attributes (used for placeholders)
47-
.highlight :is(.ge){
61+
// attributes (used for placeholders within angle brackets)
62+
.highlight :is(.ge)
63+
{
4864
color: #d52753;
4965
font-family: $fontMonoItalicBold;
5066
}
5167

52-
body.documentation .highlight code a{
68+
body.documentation .highlight code a {
5369
text-decoration-color: #23974a;
5470
text-underline-offset: .05em;
5571
text-underline-offset: 0.17em;
5672
}
5773

58-
// class names
59-
.highlight :is(.nc, .nv, .nl){
60-
color: #d52753;
61-
}
62-
63-
// punctuation
64-
.highlight :is(.p, .x){
65-
color: #7a82da;
66-
}
67-
68-
// operators
69-
.highlight :is(.o, .ow){
70-
color: #7a82da
71-
}
72-
73-
// strings
74-
.highlight :is(.ld, .s, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .dl){
75-
color: #c5a332;
76-
}
77-
7874
.language-batch code:before {
7975
content: '$ ';
8076
}
@@ -94,19 +90,11 @@ th .k {
9490
background: var(--doc-codebox-background-color, #F2F2F2);
9591
}
9692

97-
// prompt
98-
.highlight :is(.gp){
99-
color: #E15300;
100-
font-family: $fontMonoBold;
101-
}
102-
10393
.landing .highlight{
10494
padding: 15px;
10595
border: 1px solid var(--doc-codebox-border-color, #D9D9D9);
10696
}
10797

108-
109-
11098
html.darkmode,
11199
.dark{
112100
// comments

0 commit comments

Comments
 (0)