Is anyone detecting light vs dark mode on their site>

For example, I frequently use
const isMobileSize = useMediaQuery("(max-width:600px)");
const isMobileSize = useMediaQuery("(max-width:600px)");
when I need my logic to work different on mobile devices. Now
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
is just never positive? (this is using the useMediaQuery from https://suid.io/components/use-media-query )
3 Replies
Bersaelor
Bersaelor3mo ago
Ah, my problem was that I didn't change my macos device setting from light to dark, but only the chrome-settings. Apparently changing chrome alone does not affect the media-query
thetarnav
thetarnav3mo ago
tip: use this
No description
thetarnav
thetarnav3mo ago
also this I guess
No description