Closed ollebergkvist closed 1 year ago
Since a theme can be any string (for example: cyberpunk
, in daisyUI), then this also implies that there would be an option to set which theme is treated as light
and which is treated as dark
? If so, how would that be configured?
E.g. When a user who has selected dark mode in their system preferences, when entering the page the plugin defaults to dark mode?
That depends on the CSS. daisyUI does this. by default, dark
theme on daisyUI will be activated if the OS is on dark mode.
theme-change
does not care about the CSS.
This is all theme-change
does:
button
, toggle
or a <select>
So, by default, if no theme is chosen by user and your CSS has a style for @media (prefers-color-scheme: dark)
(daisyUI does) the dark style would apply. otherwise it would be light.
And if user have chose a theme, the theme name would be inside Local Storage and theme-change
will put that chosen theme in <html data-theme="______">
.
Is there a way to prioritize the system default somehow? E.g. When a user who has selected dark mode in their system preferences, when entering the page the plugin defaults to dark mode?