Skip to content

Commit 2adc8dc

Browse files
committed
Make syntax hightlight theme respect theme setting
1 parent 3c597d5 commit 2adc8dc

File tree

4 files changed

+440
-2
lines changed

4 files changed

+440
-2
lines changed

config.toml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ build_search_index = false
99
[markdown]
1010
highlight_code = true
1111
highlight_theme = "css"
12+
# The css files generated at that location aren't actually imported anywhere.
13+
# To support our own theme-switching logic, the css is manually copied into
14+
# app.scss and noscript.scss. To switch to a different theme, just go through
15+
# that process again. Select the theme here, then copy the content over.
1216
highlight_themes_css = [
1317
{ theme = "boron", filename = "styles/syntax-theme-dark.css" },
1418
{ theme = "OneHalfLight", filename = "styles/syntax-theme-light.css" },

sass/styles/app.scss

+218
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,161 @@ $header-font: 'Alfa Slab One', serif;
3131
--theme-hover: #cacaca;
3232
--theme-choice-color: black;
3333
--rust-logo-filter: initial;
34+
35+
// Below is a generated syntax highlighting theme.
36+
// Check `config.toml` for documentation on how to change it.
37+
38+
/*
39+
* theme "OneHalfLight" generated by syntect
40+
*/
41+
42+
.z-code {
43+
color: #383a42;
44+
background-color: #fafafa;
45+
}
46+
47+
.z-comment {
48+
color: #a0a1a7;
49+
}
50+
.z-variable.z-parameter.z-function {
51+
color: #383a42;
52+
}
53+
.z-keyword {
54+
color: #a626a4;
55+
}
56+
.z-variable {
57+
color: #e45649;
58+
}
59+
.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method {
60+
color: #0184bc;
61+
}
62+
.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class {
63+
color: #c18401;
64+
}
65+
.z-meta.z-class {
66+
color: #c18401;
67+
}
68+
.z-keyword.z-other.z-special-method {
69+
color: #0184bc;
70+
}
71+
.z-storage {
72+
color: #a626a4;
73+
}
74+
.z-support.z-function {
75+
color: #0184bc;
76+
}
77+
.z-string {
78+
color: #50a14f;
79+
}
80+
.z-constant.z-numeric {
81+
color: #c18401;
82+
}
83+
.z-none {
84+
color: #c18401;
85+
}
86+
.z-none {
87+
color: #c18401;
88+
}
89+
.z-constant {
90+
color: #c18401;
91+
}
92+
.z-entity.z-name.z-tag {
93+
color: #e45649;
94+
}
95+
.z-entity.z-other.z-attribute-name {
96+
color: #c18401;
97+
}
98+
.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity {
99+
color: #c18401;
100+
}
101+
.z-meta.z-selector {
102+
color: #a626a4;
103+
}
104+
.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section {
105+
color: #0184bc;
106+
}
107+
.z-markup.z-bold, .z-punctuation.z-definition.z-bold {
108+
color: #a626a4;
109+
}
110+
.z-markup.z-italic, .z-punctuation.z-definition.z-italic {
111+
color: #a626a4;
112+
}
113+
.z-markup.z-raw.z-inline {
114+
color: #50a14f;
115+
}
116+
.z-meta.z-link {
117+
color: #50a14f;
118+
}
119+
.z-markup.z-quote {
120+
color: #50a14f;
121+
}
122+
.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java {
123+
color: #383a42;
124+
}
125+
.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java {
126+
color: #383a42;
127+
}
128+
.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js {
129+
color: #e45649;
130+
}
131+
.z-source.z-js .z-variable.z-other.z-readwrite.z-js {
132+
color: #e45649;
133+
}
134+
.z-source.z-js .z-variable.z-other.z-object.z-js {
135+
color: #383a42;
136+
}
137+
.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js {
138+
color: #e45649;
139+
}
140+
.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js {
141+
color: #e45649;
142+
}
143+
.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js {
144+
color: #383a42;
145+
}
146+
.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js {
147+
color: #383a42;
148+
}
149+
.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js {
150+
color: #383a42;
151+
}
152+
.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js {
153+
color: #0184bc;
154+
}
155+
.z-source.z-js .z-support.z-constant.z-prototype.z-js {
156+
color: #383a42;
157+
}
158+
.z-markup.z-inserted {
159+
color: #98c379;
160+
}
161+
.z-markup.z-deleted {
162+
color: #e06c75;
163+
}
164+
.z-markup.z-changed {
165+
color: #e5c07b;
166+
}
167+
.z-string.z-regexp {
168+
color: #50a14f;
169+
}
170+
.z-constant.z-character.z-escape {
171+
color: #0997b3;
172+
}
173+
.z-invalid.z-illegal {
174+
color: #fafafa;
175+
background-color: #e06c75;
176+
}
177+
.z-invalid.z-broken {
178+
color: #fafafa;
179+
background-color: #e5c07b;
180+
}
181+
.z-invalid.z-deprecated {
182+
color: #fafafa;
183+
background-color: #e5c07b;
184+
}
185+
.z-invalid.z-unimplemented {
186+
color: #fafafa;
187+
background-color: #c678dd;
188+
}
34189
}
35190

36191
// Dark theme
@@ -59,6 +214,69 @@ $header-font: 'Alfa Slab One', serif;
59214
--theme-hover: #474c51;
60215
--theme-choice-color: #d5cbc6;
61216
--rust-logo-filter: drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);
217+
218+
// Below is a generated syntax highlighting theme.
219+
// Check `config.toml` for documentation on how to change it.
220+
221+
/*
222+
* theme "Boron" generated by syntect
223+
*/
224+
225+
.z-code {
226+
color: #e8e8d3;
227+
background-color: #151515;
228+
}
229+
230+
.z-comment {
231+
color: #888888;
232+
}
233+
.z-string {
234+
color: #99ad6a;
235+
}
236+
.z-punctuation.z-definition.z-string.z-begin, .z-punctuation.z-definition.z-string.z-end {
237+
color: #556633;
238+
}
239+
.z-constant.z-other {
240+
color: #7697d6;
241+
}
242+
.z-string.z-regexp {
243+
color: #dd0093;
244+
}
245+
.z-variable, .z-support.z-class {
246+
color: #ffb964;
247+
}
248+
.z-constant.z-numeric {
249+
color: #cf6a4c;
250+
}
251+
.z-entity {
252+
color: #ffb964;
253+
}
254+
.z-entity.z-name.z-function {
255+
color: #fad07a;
256+
}
257+
.z-keyword.z-control {
258+
color: #8fbfdc;
259+
}
260+
.z-storage {
261+
color: #8fbfdc;
262+
}
263+
.z-diff.z-inserted, .z-markup.z-inserted {
264+
color: #558f1f;
265+
}
266+
.z-diff.z-deleted, .z-markup.z-deleted {
267+
color: #a1000d;
268+
}
269+
.z-meta.z-diff.z-header {
270+
color: #ffffff;
271+
background-color: #4e738a;
272+
}
273+
.z-meta.z-diff.z-range {
274+
color: #888888;
275+
font-style: italic;
276+
}
277+
.z-markup.z-changed {
278+
color: #967efb;
279+
}
62280
}
63281

64282
html {

0 commit comments

Comments
 (0)