News for hackers. Stuff that matters.
Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by qingcharles on Monday October 09, 2023 @06:47PM (#37826412)
How does this deal with the ternary of light/dark/high-contrast that a lot of sites are now using?

I wish they would just enable features that are already in the browser that they've not put live, like grid-template-rows: masonry. All three major engines have the damned thing in there but it's not in release branch.

Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by johngalt2600 on Monday October 09, 2023 @08:39PM (#37827257)
if browsers have support for a feature such as masonry, but it is not enabled in css spec does that mean it cannot be used? I recall seeing masonry in a tailwind talk, very neat!
Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by qingcharles on Monday October 09, 2023 @09:44PM (#37827686)
Well, most people implement it using JavaScript if you want everything to be in the correct order. I use a pure CSS variant as I'm trying to go near-zero JS on my projects these days, but it means things are out-of-order. Depends on your use case.

I also check for CSS support in the browser using the "supports" feature and utilize the native support if it is enabled (e.g. Firefox behind a flag, and Safari behind a switch).

Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by gwern on Monday October 09, 2023 @09:29PM (#37827591)
There's also the light/dark/system (auto) ternary approach, which this seems to encourage the designer to ignore in favor of a binary toggle. It seems to beg the developer to treat the mode as a negation of whatever it currently is, which leads to bad results and time-dependency of setting.
Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by qingcharles on Monday October 09, 2023 @09:45PM (#37827690)
Exactly. I'm not sure this is totally thought-out.

p.s. love your work

Re:The Future of CSS: Easy Light-Dark Mode Color Switching w... by bramus on Tuesday October 10, 2023 @06:40AM (#37830445)
Masonry isn’t ready to be shipped as there are still quite a few open spec issues [^1] that need to be resolved first.

[^1]: https://github.com/w3c/csswg-drafts/issues?q=is%3Aissue+is%3...