I mean, light-dark is great as a function to have to enbrief specifically the use-case of light vs dark themes, but that duality is so limited I don't even use the function. I use media queries and prefers-color-scheme to be able to support arbitrary themes easily. This way I have to worry about compatibility far less, too.
post
It’s available in all relevant browsers since 2024 so there is not one single real reason to not use it.
I still prefer the prefers-color-scheme media query because it makes it easier to properly separate the color schemes in code.
all 2 comments