Skip to main content


CSS only dark mode without JS – Simon Dalvai
This css one liner can define how your site looks on a device with dark mode set in the browser settings.

@media (prefers-color-scheme: dark)

Or if your main style is dark mode, you can define how the light mode will look.

@media (prefers-color-scheme: light)
Source: CSS only dark mode without JS - Simon Dalvai
https://monodes.com/predaelli/2023/08/13/css-only-dark-mode-without-js-simon-dalvai/
#Web #CSS
#css #web

This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.