Open MathiasGretland opened 1 month ago
^^ Title
Whenever the localStorage key is not set
react-library-playground-theme
(not set the first time you enter the site), then some colors are off if the system pref is set to dark mode.This seems to only be related to the icons, so we might have to look for a better way to check
isDarkModeSet
inThemeProviderUtils
as this only checks for the localStorage key and not for theprefers-color-scheme
(which most likely here is set to "light". Example illustration to check this would be to have a console log, like:
console.log(Window.matchMedia("(prefers-color-scheme: light)")
See screenshot for illustration:
Thank you for your detailed observation and suggestion! I appreciate that.
^^ Title
Whenever the localStorage key is not set
react-library-playground-theme
(not set the first time you enter the site), then some colors are off if the system pref is set to dark mode.This seems to only be related to the icons, so we might have to look for a better way to check
isDarkModeSet
inThemeProviderUtils
as this only checks for the localStorage key and not for theprefers-color-scheme
(which most likely here is set to "light". Example illustration to check this would be to have a console log, like:console.log(Window.matchMedia("(prefers-color-scheme: light)")
See screenshot for illustration:![Screenshot 2024-07-21 at 23 33 29](https://github.com/user-attachments/assets/fe90f5da-1c6c-4350-847f-0633d3e4db7d)