-
Hi all, We are having some difficulties in implementing the desired color modes behaviour in our app and would appreciate some help. We are using
We tried to implement this behaviour with the Our color modes are properly implemented in the Ideally, we would like to use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yes, this would be the perfect behaviour. This is a very good question. So the problem is, because of Unfortunately, I don't have a built-in convenient solution for you. Unifying color mode state and the color scheme media query options into one value is a very neat idea for future versions. I've hacked a workaround really quickly — https://codesandbox.io/s/loving-clarke-iofv4t?file=/src/App.tsx |
Beta Was this translation helpful? Give feedback.
Yes, this would be the perfect behaviour. This is a very good question.
So the problem is, because of
useColorSchemeMediaQuery
is set tosystem
, Theme UI disregards the color scheme value in localStorage, right?Unfortunately, I don't have a built-in convenient solution for you. Unifying color mode state and the color scheme media query options into one value is a very neat idea for future versions.
I've hacked a workaround really quickly — https://codesandbox.io/s/loving-clarke-iofv4t?file=/src/App.tsx
This is by no means elegant, but maybe it can help you just a bit.