Please use `prefers-color-scheme` to respect users' environments and default preferences instead. It's also worth noting that, for some people, this is more than just a cosmetic choice.
>Automatically setting the theme is a nice touch for most, but accessibility comes first, and if the user has a preference, it's always right to respect their choice.
>You can check for users' colour scheme preferences in CSS & JavaScript with the following snippets: