r/FirefoxCSS • u/kousik19 • Sep 28 '20
Code Do you really think using a single line of CSS, you can change your site into dark theme?
https://youtu.be/HIuRr-zzq7A[removed] — view removed post
1
u/Trout_Tickler Sep 28 '20
img, picture, video {
filter: invert(1) hue-rotate(180deg)
}To not break media.
1
2
u/Snoo-28514 Sep 28 '20
LOL
> download giant CSS file
> include it, invoke the main function that inverts the colors
title: How to hack facebook and change the background to black in 1 line
0
u/It_Was_The_Other_Guy Sep 28 '20
Yeaaah no.
As you can see, using invert filter (with any variable combination of other filters) messes up all other colors and it may or may not disable text anti-aliasing. And you can't use that method to "de-invert" background-images but only img/svg/video elements - so have fun with that.
Moreover (and probably more to the interest of this sub), while you can selectively apply it to specific websites you can't really apply that filtering globally as user-mode style because guess what, it's gonna invert websites that are natively in dark-mode too and there's nothing you can do about that with css alone.
1
u/kousik19 Sep 28 '20
Agreed. It's nothing but a quick trick. Not an ultimate professional solution. 🙂
2
u/FineBroccoli5 Sep 28 '20
Theoreticaly? Yes. Practicaly? You will need a bit more then one line bit it's still really managable. Also here is much much better video about this
https://youtu.be/qimopjP6YoM
(If I'm right this one was the first (or one of the first) on this ("one line css dark mode") topic)