Re: [csswg-drafts] [css-color-5] Add `currentBackgroundColor` Variable (#5292)

In the interest of including more use cases, here's my current one:

I'm currently working on modifying a Hugo theme that I didn't create. The original creator used the pre-compiled, CDN version of Semantic UI, which includes a number of classes that apply a certain background color. The theme was created before light/dark mode switching, and the colors look garish in dark mode, because they're designed for light.

Now, I *could* go in, find all the relevant color values, copy them into my set of variables for light and dark schemes, then change the dark ones, individually. This is looking increasingly like the route I have to go. The downside here is that I'll need to do it for any background color reference I have to deal with. (I could also switch to the uncompiled Less version of Semantic, so I have their more proper theming support, but that would introduce a bunch of overhead that I don't currently have and would rather avoid.)

What I'd *like* to do, is something along the lines of `color-mix(in oklch, currentBackgroundColor, black 25%)` and keep essentially the same colors, just darken them a bit, so that they better match the dark theme and aren't practically glowing, without having to care exactly what color each was originally. This way, I have basically one little block to change, instead of making a dozen for essentially the same change.

-- 
GitHub Notification of comment by ShaunaGordon
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5292#issuecomment-2161542966 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 11 June 2024 20:20:08 UTC