Open ApexDevelopment opened 8 months ago
If the user has "follow system theme" selected, window.matchMedia("(prefers-color-scheme: dark)")
and window.matchMedia("(prefers-color-scheme: light)")
would allow detecting which theme to apply. But to even detect what theme the user selected, we probably either have to query the Cohost API or scan the document for elements with the data-theme
attribute.
Cohost has dark mode, light mode, and an option to follow your system's theme. All three options apply different changes to the DOM. This makes it very difficult to write a theming engine that works regardless of what setting the user chose. There are three options:
I'm thinking option 1 or option 3 are probably best, but I'm dreading implementing any of the above.