fix(markdown): invert TikZ SVGs on dark themes for readability

This commit is contained in:
Julien Calixte
2026-05-16 11:47:31 +02:00
parent a4d9774191
commit f3708b2f9d

View File

@@ -202,6 +202,18 @@ pre.tikz svg {
height: auto; height: auto;
} }
/* TikZ SVGs are monochrome black; invert them on dark themes so they
remain readable on the transparent background. */
[data-theme="dracula"] pre.tikz svg {
filter: invert(1) hue-rotate(180deg);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) pre.tikz svg {
filter: invert(1) hue-rotate(180deg);
}
}
.tikz-loading { .tikz-loading {
opacity: 0.6; opacity: 0.6;
font-style: italic; font-style: italic;