Reactive CSS's prefers-color-scheme ?

I want to detect CSS prefers-color-scheme's changed. I can make a event listener like window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => { const isDarkMode = e.matches // Do something }) But it doesn't looks like Solid way. Is there more elegant way?
1 Reply
musiclover
musicloverOP2y ago
GitHub
solid-primitives/packages/media at main · solidjs-community/solid-p...
A library of high-quality primitives that extend SolidJS reactivity. - solid-primitives/packages/media at main · solidjs-community/solid-primitives
Want results from more Discord servers?
Add your server