Add dark mode to your website with a single line of code
1–9 of 9 posts
Re: Add dark mode to your website with a single line of code
#2Which means importing a whole js file
Re: Add dark mode to your website with a single line of code
#3 :root { color-scheme: light dark; }
I don't think you need a library for that.Re: Add dark mode to your website with a single line of code
#4> a single line of code Which means importing a whole js file
Re: Add dark mode to your website with a single line of code
#5You can in fact add dark mode with a single line of code (CSS, not JS), as long as you don't change any colors: :root { color-scheme: light dark; } I don't think you need a library for that.
Re: Add dark mode to your website with a single line of code
#6You can in fact add dark mode with a single line of code (CSS, not JS), as long as you don't change any colors: :root { color-scheme: light dark; } I don't think you need a library for that.
html { filter: invert(100%); }Re: Add dark mode to your website with a single line of code
#7You can in fact add dark mode with a single line of code (CSS, not JS), as long as you don't change any colors: :root { color-scheme: light dark; } I don't think you need a library for that.
Not a web dev, but I saw this on a stream at some point and found it delightful. Surprisingly effective! html { filter: invert(100%); }
Re: Add dark mode to your website with a single line of code
#8Re: Add dark mode to your website with a single line of code
#9> a single line of code Which means importing a whole js file