📦 Build a dark mode toggle with CSS variables. #DarkMode #CSSVariables #SmartSnippet #AllDayDSK
3
2
5
66
0
Download Image
Toggles are nice, it lets the user choose between the color scheme and add a nice UX feature. In the other hand queries adapt to the system scheme automatically… I still don’t know which offers the smoother experience @media (prefers-color-scheme: dark) { body { background-color: black; color: white; } } @media (prefers-color-scheme: light) { body { background-color: white; color: black; } }
@Smart_Snippet @Oz_70th This is the best thing happend to #CSS and web developement, me myself prefer darkmode, reason why i usually develope admin templates in darkmode