Commutatore modalità scura/chiara offre risultati contrastanti quando le impostazioni del sistema operativo non corrispondono alle impostazioni del commutatore

@media (prefers-color-scheme: dark) CSS styles in my theme components are ignored if the user’s OS system is set to light mode and the user selects dark mode in the sidebar toggle. I also get weirdness if the user’s OS system is set to dark yet they select light in the sidebar toggle. Everything looks as intended when the OS system and toggle match modes. Has anyone else run into this issue and figured out how to get their light/dark mode CSS tweaks to apply when the OS settings and sidebar toggle settings do not match?