4 ms·
Remember that the projects you work on are not typical of most CSS usage in the world. For small projects that never need to "scale", this looks handy.
by stevage 3y ago
Remember that the projects you work on are not typical of most CSS usage in the world.
For small projects that never need to "scale", this looks handy.
- hyperhopper 3y agoEven if you never need to scale, Having light/dark & high contrast is just having basic features and complying to the law. If your site has 50 users it should have these, and this new light/dark switch is still inappropriate for even this basic use case.
- extra88 3y agoWhat law? The U.S.'s Section 508 and other laws and regulations based on WCAG, don't require that sites honor `prefers-color-scheme` or to work correctly when `forced-colors` is active. Nevertheless, it's a good idea to do so (though if a site honors `prefers-color-scheme` it should also have a setting so the user can choose to have that site not match their system's color scheme setting).
- jjcm 3y agoVery true! Nonetheless this approach would also break compatibility with `color-scheme`'s custom identifiers, which is just bad in general for CSS even for these small projects. The alternative proposal I put together here would allow this to scale and still provide a helper function for small projects to use: https://github.com/w3c/csswg-drafts/issues/7561#issuecomment-1754069460 https://github.com/w3c/csswg-drafts/issues/7561#issuecomment...
- wldcordeiro 3y agoI appreciate that you not only have a nuanced critique but an alternative proposal as well.
- stevage 3y agoI do like your alternative proposal. For the viewers at home: :root { color-scheme: light dark high-contrast; } body { background: scheme(light #eee, dark #333, high-contrast #fff); }