Re: [csswg-drafts] [css-variables?] Higher level custom properties that control multiple declarations (#5624)

Thanks for your responses @LeaVerou. Learning a lot here.

> anything selector-based cannot depend on computed styles, as cascading needs to be processed earlier.

This is what I feared in that last paragraph .Makes total sense though.

> we may as well ditch the `@var()` and just specify the `<dashed-ident>` to compare against.

Side note: I first thought of this syntax, but although uncommon — and not against [spec rules](https://html.spec.whatwg.org/#attributes-2) apparently — I learned that you can create HTML attributes that start with `--` and already target them from CSS using `[--attribute]` (#til). See [this pen](https://codepen.io/bramus/pen/poEVxjY) for a short demo.

> I'm not sure how `@if` is imperative

True, technically it's a simple control structure. When mentioned within a CSS context I see people either get really excited or the exact opposite it as it reminds them a wee bit too much of (imperative) programming. It's a perception thing. _(I personally would welcome it very much 😊)_

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


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

Received on Tuesday, 5 January 2021 20:41:20 UTC