W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

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

From: Bramus! via GitHub <sysbot+gh@w3.org>
Date: Tue, 05 Jan 2021 20:41:05 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-754886408-1609879264-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:38 UTC