Skip to content

Commit bfba00c

Browse files
site: render diagrams for the dark theme
The diagram SVGs are light-theme images loaded through <img>, so they cannot read data-theme. Invert and hue-rotate them when the theme is dark; the white card turns near-black and the blue palette stays blue. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1f54da4 commit bfba00c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

osmium/src/index.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080
img {
8181
@apply rounded-xl;
8282
}
83+
84+
/* Diagrams are hand-drawn light-theme SVGs served as images, so they cannot
85+
read data-theme themselves. Invert and rotate hue in dark mode: the
86+
white card turns near-black and the blue palette stays blue. */
87+
html[data-theme*="dark"] img[src^="/images/diagrams/"] {
88+
filter: invert(0.92) hue-rotate(180deg);
89+
}
8390
}
8491

8592
.shiki.material-theme-ocean {

0 commit comments

Comments
 (0)