Dark Mode Toggle without Javascript
Written by Lucie Zdeňková on 2025-01-02
The following code snippets of HTML and CSS demonstrates a simple setup to enable dark mode using only HTML and CSS, without any JavaScript. This solution takes user preferences into account and allows the user to manually toggle between light and dark mode. Practical example can be seen in the header of this page.