- From: EricSL via GitHub <noreply@w3.org>
- Date: Wed, 22 Oct 2025 11:42:17 +0000
- To: public-css-archive@w3.org
It does make the common case more verbose and that may be sufficient reason not to adopt this for mixins.
You could use `container-var` for the host case provided you have no other reason to make the host a named container. Using it for the scoped case correctly is quite complicated:
```css
* {
--depth: calc(inherit(--depth, 0) + 1);
}
@mixin --apply-color-to-nested(--color) {
scope(&) {
:scope {
--color-to-apply: var(--color);
--container-name-for-scope: ident(--scope-at var(--depth));
container-name: var(--container-name-for-scope);
}
.nested-1 {
--container-name-for-nested-1: inherit(--container-name-for-scope);
.nested-2 {
color: container-var(inherit(--container-name-for-nested-1), --color-to-apply);
}
}
}
}
```
There is nothing truly necessary about this proposal (unless there is a need for cases like `parent parent`); it would also work to have `inherit()`, `container-var()`, `scope-var()`, and `caller-var()` or whatever is needed for #12987.
--
GitHub Notification of comment by EricSL
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12990#issuecomment-3431956266 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 22 October 2025 11:42:18 UTC