(Asking as someone who wants to create website) How to make website support dark mode without javascript?
(Asking as someone who wants to create website) How to make website support dark mode without javascript?
9
comments
24 0 ReplyThis should help you
https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/
13 0 ReplyIf you're not wanting to use JS then you're reliant on the users browser supporting
prefers-color-scheme
(caniuse) or forcing them to reload the page.6 1 ReplyUse CSS
5 1 Reply<a href="dark-page.html">Dark Mode</a>
5 1 ReplyYou can style both dark mode and light mode with CSS but the question is how will you toggle between them? A button? Then you need JavaScript
2 2 ReplyThe user can toggle their operating system's setting. During development, the developer can do it in their browser's dev tools.
5 0 Reply
Locking as this post violates rule 5.
4 8 ReplyJust use JavaScript.
1 10 Reply
You've viewed 9 comments.
Scroll to top