mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Auto theme: do not load default-light.css file if dark mode is preferred (#2764)
The previous code was importing both files (`default-light.css` and `default-dark.css`) when dark mode was set. Due to small differences between these themes, some elements were retaining Light styles on the Dark theme. Now only one file is imported.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* Code courtesy of https://blog.jim-nielsen.com/2019/conditional-syntax-highlighting-in-dark-mode-with-css-imports/ */
|
||||
|
||||
/* Assume light mode by default */
|
||||
@import "default-light.css" screen;
|
||||
/* Supersede dark mode when applicable */
|
||||
/* Import light mode if color-scheme is different than dark (even not set) */
|
||||
@import "default-light.css" screen and not (prefers-color-scheme: dark);
|
||||
/* Import dark mode when applicable */
|
||||
@import "default-dark.css" screen and (prefers-color-scheme: dark);
|
||||
|
||||
Reference in New Issue
Block a user