TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Add dark mode to your website with a single line of code

17 pointsby 0natcerover 1 year ago

2 comments

emaroover 1 year ago
You can in fact add dark mode with a single line of code (CSS, not JS), as long as you don&#x27;t change any colors:<p><pre><code> :root { color-scheme: light dark; } </code></pre> I don&#x27;t think you need a library for that.
评论 #38498196 未加载
评论 #38498221 未加载
Alifatiskover 1 year ago
&gt; a single line of code<p>Which means importing a whole js file
评论 #38499624 未加载
评论 #38498155 未加载