Live data from Hacker News

The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

bram.us

61–70 of 74 posts

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#61

Remember when UIs were customisable to the point that you could choose any colour for all the elements? Now it's "you can have any colour you want, as long as it's light or dark", and all of a sudden "dark mode" is heralded as something revolutionary and new. CSS3 even deprecated the "system colors" feature that was meant to allow the same degree of UI customisation we had before for websites too. It's nothing but a…

> CSS3 even deprecated the "system colors" feature

Specific system color keywords were deprecated but the idea of system color keywords was not. They're essential for when `forced-colors` is active.

https://developer.mozilla.org/en-US/docs/Web/CSS/system-colo...

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#63
post #49

Dark mode is a weird phenomenon, I think. It kind of came out of nowhere and suddenly everything in existence started adding a dark mode and prominently listing it as a top features. That is not a complaint or anything like that, just an observation that dark mode seems to have spread in an unusual way compared to other technologies. But might of course also be just my perception.

The alternative is sick eyes

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#64
post #51
post #21

I've done a LOT of dark mode work, to the point where I'd consider myself an expert here[1]. I'm not a fan of this. This solves one tiny aspect of the larger problem in a non-scalable way that will inevitably lead to bloat and inflexibility. It's a really a naive approach that hasn't taken into account design at scale, nor the future of where design is heading. Typically when doing theming, you have two axes - a visu…

> If you wanted to actually solve theming, what you should work for is not a constrained helper function like light-dark(), but instead a shared token schema. Today nearly every company has their own token schema and different ways of naming things in the semantic token layer. If we had a shard language here, not only would it be trivial to add light/dark theming (just redefine a few variables that are already provid…

There's millions of downloads every week for mui and bootstrap. Anyone using them is using something like theme-ui.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#65
post #21

I've done a LOT of dark mode work, to the point where I'd consider myself an expert here[1]. I'm not a fan of this. This solves one tiny aspect of the larger problem in a non-scalable way that will inevitably lead to bloat and inflexibility. It's a really a naive approach that hasn't taken into account design at scale, nor the future of where design is heading. Typically when doing theming, you have two axes - a visu…

> shared token schema Could you explain or give an example of what this is?

theme-ui (https://theme-ui.com/getting-started), mui's `Theme` (https://mui.com/material-ui/customization/default-theme/), bootstrap's variables

Basically, when you think in purpose instead of colors.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#66
post #63
post #49

Dark mode is a weird phenomenon, I think. It kind of came out of nowhere and suddenly everything in existence started adding a dark mode and prominently listing it as a top features. That is not a complaint or anything like that, just an observation that dark mode seems to have spread in an unusual way compared to other technologies. But might of course also be just my perception.

The alternative is sick eyes

I actually remember from my software ergonomics course at university that black on white is better than white on black. I guess it stuck because it surprised my, I always considered the MS-DOS console easier to read. I do not remember any details, but I guess it must have been about working in a well lit office or something like that. Dark mode is probably only advantageous because we nowadays use screens in a lot of situations with all but ideal lighting.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#67

Oof. Unless I’m missing something, this is a convenience that doesn’t enable anything new and uses syntax/terms that don’t naturally generalize for future applications. It just embeds one recent trend in very specific, very rigid terms. This is how standards get bloated.

I agree. You can already do this using the space toggle technique: :root { --dark: ; } @media (prefers-color-scheme: dark) { --light: ; --dark:initial; } .example { color: var(--light, #000) var(--dark, #fff); }

Correction, the media query should have been:

@media (prefers-color-scheme: dark) { :root { --light: ; --dark:initial; } }

Missed the selector.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#68
post #21

I've done a LOT of dark mode work, to the point where I'd consider myself an expert here[1]. I'm not a fan of this. This solves one tiny aspect of the larger problem in a non-scalable way that will inevitably lead to bloat and inflexibility. It's a really a naive approach that hasn't taken into account design at scale, nor the future of where design is heading. Typically when doing theming, you have two axes - a visu…

Jira has a dark mode??

Does now. It's pretty nice.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#69
post #28

I’m consistently amazed at how much energy has been put into the light/dark UI pattern for web and mobile apps. Way way more than was ever put into dealing with colorblindness or any other form of color adjustment imo. It’s nice to have the choice but I also wonder what else might have been done with all that UX/UI design and SWE time.

That seems to be linked to the spreading belief that this is a health issue instead of an aesthetic preference. Those who now believe this option somehow hurts their healthy eyes might already outnumber the actually colorblind.

Nah, that's not what it is. It's just fashion. Dark mode is the new flat icon.

Re: The Future of CSS: Easy Light-Dark Mode Color Switching with Light-Dark()

#70
Often I want "a bit darker" just to take the edge off blinding white light. This HN page for example, I use the Stylus browser extension to reduce the background white of page and this text box to a medium grey. Same for Wikipedia. I tried making a Stylus entry that worked on any website, but couldn't do it.
Post reply on HN