RetroFed Forums
Your home away from modern life.
Using light-dark() without getting caught out
Post Reply
AuthorMessage
codeinabox programming.dev codeinabox@programming.dev
Joined: 2025-09-29
Quote

6   Original
lambalicious lemmy.sdf.org lambalicious@lemmy.sdf.org
Joined: 2023-07-26
#2 · Quote Reply

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.

2
π˜‹π˜ͺ𝘳𝘬 lemmy.ml Dirk@lemmy.ml
Joined: 2023-06-09
#3 · Quote Reply

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.

2
Post Reply
Back to top