Skip to content

Commit 78a73ca

Browse files
committed
Fix dark mode for SVG figures inlined by Docusaurus
1 parent b214738 commit 78a73ca

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/css/custom.css‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,15 @@ code {
775775
}
776776
}
777777

778-
/* ── Figures: black line art from static/assets, inverted in dark mode ─── */
779-
.markdown img[src^="/assets/"] {
778+
/* ── Figures: black line art SVGs from static/assets, inverted in dark mode ───
779+
Small SVGs are inlined as data URIs at build time, so match both forms */
780+
.markdown img[src^="data:image/svg+xml"],
781+
.markdown img[src$=".svg"] {
780782
display: block;
781783
margin: 1.5rem auto;
782784
}
783785

784-
[data-theme="dark"] .markdown img[src^="/assets/"] {
786+
[data-theme="dark"] .markdown img[src^="data:image/svg+xml"],
787+
[data-theme="dark"] .markdown img[src$=".svg"] {
785788
filter: invert(0.88);
786789
}

0 commit comments

Comments
 (0)