Skip to content

Commit 4c1007c

Browse files
committed
assets/css: sync color-scheme with Chirpy dark mode toggle
SVGs using the CSS light-dark() function only respond to the color-scheme property, not data-mode attributes. Without this fix, draw.io diagrams would ignore the blog's dark/light toggle and only follow the OS-level preference. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent ef866a6 commit 4c1007c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

assets/css/jekyll-theme-chirpy.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
';
99

1010
/* append your custom style below */
11+
12+
/* Sync CSS color-scheme with Chirpy's JS dark mode toggle so that SVGs
13+
using the light-dark() CSS function (e.g. draw.io diagrams) respond to
14+
the blog's dark/light toggle rather than only the OS-level preference. */
15+
html[data-mode=dark] {
16+
color-scheme: dark;
17+
}
18+
html[data-mode=light] {
19+
color-scheme: light;
20+
}
1121
pre.highlight {
1222
line-height: 1.2em;
1323
}

0 commit comments

Comments
 (0)