Favorite website doesn't have a dark mode? Add these two lines in the Stylus extension and it will:

html, img, video { filter: invert(1) hue-rotate(180deg); }
html { background: ; text-shadow: 0 0; }

(It works nearly everywhere.)

@qwazix Thanks!

It could even be a 1-liner for most sites too, but splitting it like this makes it work with more pages (setting background to white) and prevents the flash of white for images (if background would be set for img too).

My original 1-liner:

html, img, video { filter: invert(1) hue-rotate(180deg); text-shadow: 0 0; }

The big aha-moment was when I realized that img & video were reversible with the same CSS filter as html. It's kind of a rot13 of color. 😉

Sign in to participate in the conversation

Generalistic and moderated instance. All opinions are welcome, but hate speeches are prohibited. Users who don't respect rules will be silenced or suspended, depending on the violation severity.