- From: Lea Verou via GitHub <noreply@w3.org>
- Date: Thu, 26 Mar 2026 23:01:46 +0000
- To: public-css-archive@w3.org
@andruud I'm …lost about what in any of my comments may have sounded like I'm not proposing we drop hygienic rewriting. Being able to have local variables that cannot clash with outside variables is _extremely_ important!
What I'm talking about is:
- When and on what element typed arguments should resolve
- My understanding (that @tabatkins confirmed) is that scoping was introduced to restrict rules to descendants, and rules had to be restricted to descendants only so that arguments could be used everywhere and still inherit as expected. I'm exploring whether there could be an alternative way to do those things without these restrictions which [authors find extremely weird](https://front-end.social/@leaverou/116297811172593173).
> @function --double-it(--arg) {
> --mywidth: 300px;
> result: calc(var(--arg) * 2);
> }
>
> div {
> --mywidth: 100px;
> width: --double-it(var(--mywidth));
> }
> How wide do you expect `div` to be here?
This is what my expectation would be:
- `--double-it` would be called with an `--arg` of `100px`
- `--mywidth` inside the function is rewritten to a different (unobservable) name and therefore has nothing to do with `--mywidth` on `div`, so it's effectively ignored as it's not used
- Therefore, `result` is `200px`
--
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13727#issuecomment-4138877467 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 26 March 2026 23:01:47 UTC