From f3708b2f9dfe50947e903990fa1e1a0b8af8441f Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 16 May 2026 11:47:31 +0200 Subject: [PATCH] fix(markdown): invert TikZ SVGs on dark themes for readability --- src/styles/app.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/styles/app.css b/src/styles/app.css index 0634051..3a22a92 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -202,6 +202,18 @@ pre.tikz svg { 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 { opacity: 0.6; font-style: italic;