- From: andruud via GitHub <noreply@w3.org>
- Date: Wed, 25 Mar 2026 23:12:11 +0000
- To: public-css-archive@w3.org
Under the current requirement of variable hygiene, and assuming that we're not going to drastically change very fundamental parts of CSS (like inheritance), I don't think this is hard, I think it's _impossible_. You easily end up in a situation where you need to know the value of `var(--arg)` _right now_ based on information that can only exist in the future.
```css
@mixin --sync-width(--arg <length>) {
width: var(--arg); /* 100px */
#ancestor:has(&) {
width: var(--arg); /* 100px, as long as you have a time machine. */
}
}
#ancestor {
font-size: 20px;
}
#descendant {
font-size: 10px;
@apply --sync-width(10em);
}
```
Here, we need to evaluate `var(--arg)` in order to compute `width` on `#ancestor`, but doing that requires a computed value on an element _below us_.
```css
--arg-c5f2d35-length: var(--arg-c5f2d35); /* 100px for div, 200px for > figure, 300px for & + p! */
```
Isn't this the result we want to _avoid_?
> But is the scoping rule the only way to address this problem?
If scoping is not acceptable, then it seems to me like we have to give up on hygienic arguments.
--
GitHub Notification of comment by andruud
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13727#issuecomment-4130420294 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 25 March 2026 23:12:11 UTC