Re:I use excalidraw to manage my diagrams for my blog
by mlysk on Monday March 30, 2026 @11:29AM
(#47575574)
My goal is that it renders on GitHub as well as on my blog. GitHub doesn’t support css based dark mode afaik
[ Parent
| on HN ]
Re:I use excalidraw to manage my diagrams for my blog
by tasuki on Monday March 30, 2026 @03:42PM
(#47578789)
Ah, you have a button for the toggle! Did you know that you can conform to the user's light/dark preference with CSS? Like this:
:root { --varname: #FFE; }
@media (prefers-color-scheme: dark) {
:root { --varname: #022; }
}
Edit: To expand on this, I dislike light/dark toggles. If I have dark mode on, seeing a bright screen and having to search for a toggle is jarring. Just show me the colours according to my preference!
Re:I use excalidraw to manage my diagrams for my blog
by auraham on Monday March 30, 2026 @05:06PM
(#47579708)
How can you detect the system preferences in the browser?
Re:I use excalidraw to manage my diagrams for my blog
by tasuki on Monday March 30, 2026 @05:26PM
(#47579911)
I answered that in the comment you're replying to. If you want a more authoritative answer: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...
Re:I use excalidraw to manage my diagrams for my blog
by pinjasaur on Monday March 30, 2026 @06:06PM
(#47580310)
Last I checked on this the workaround is embedding CSS inside an SVG, here's a demo: https://github.com/sindresorhus/css-in-readme-like-wat
I used this on a personal project to add a README logo that is dark mode friendly: https://paul.af/github-readme-dark-mode