Skip to content

Commit 3c597d5

Browse files
authored
Add light theme for syntax hightlighting (#1572)
1 parent 09f84a7 commit 3c597d5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
/site
99
/public
1010

11+
# generated by zola
12+
/static/styles/syntax-theme-dark.css
13+
/static/styles/syntax-theme-light.css
14+
1115
# these are old compiled sass files, people might still have them lying arouynd
1216
/static/styles/vendor.css
1317
/static/styles/app.css

config.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ build_search_index = false
88

99
[markdown]
1010
highlight_code = true
11-
highlight_theme = "boron"
11+
highlight_theme = "css"
12+
highlight_themes_css = [
13+
{ theme = "boron", filename = "styles/syntax-theme-dark.css" },
14+
{ theme = "OneHalfLight", filename = "styles/syntax-theme-light.css" },
15+
]
1216
bottom_footnotes = true
1317
insert_anchor_links = "left"
1418
extra_syntaxes_and_themes = ["syntaxes"]

templates/headers.html

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<link rel="stylesheet" href="{{ config.base_url | safe }}/styles/tachyons.css"/>
2020
<link rel="stylesheet" href="{{ config.base_url | safe }}/styles/fonts.css"/>
2121
<link rel="stylesheet" href="{{ config.base_url | safe }}/styles/app.css"/>
22+
<link rel="stylesheet" type="text/css" href="/styles/syntax-theme-dark.css" media="(prefers-color-scheme: dark)" />
23+
<link rel="stylesheet" type="text/css" href="/styles/syntax-theme-light.css" media="(prefers-color-scheme: light)" />
2224

2325
<!-- stylesheet for user agents without js -->
2426
<noscript>

0 commit comments

Comments
 (0)