Comment

Comment by cantSpellSober

What if, in the future, we have more than two options (light and dark)?

@media (prefers-color-scheme: [name]) seems more extensible, but this feels simpler and easier to read.

Glad the function accepts custom properties (CSS "variables").

Should probably add a color property that doesn't use this function as a fallback for browsers that don't support it.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton