TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Add dark mode to your website with a single line of code
17 points
by
0natcer
over 1 year ago
2 comments
emaro
over 1 year ago
Collapse
You can in fact add dark mode with a single line of code (CSS, not JS), as long as you don't change any colors:<p><pre><code> :root { color-scheme: light dark; } </code></pre> I don't think you need a library for that.
评论 #38498196 未加载
评论 #38498221 未加载
Alifatisk
over 1 year ago
Collapse
> a single line of code<p>Which means importing a whole js file
评论 #38499624 未加载
评论 #38498155 未加载