[csswg-drafts] [css-mixins-1] How is name lookup done? (#12670)

sesse has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-mixins-1] How is name lookup done? ==
Consider the following stylesheet, which defines the same mixin name twice:

```
@mixin --m1() {  /* Called m1-top below, for sake of discussion */
  color: blue;
}
@mixin --m2() {
  @apply --m1;
}
#foo {
  @apply --m1;
}
@mixin --m1() {  /* Called m1-bottom below, for sake of discussion */
  color: violet;
}
#bar {
  @apply --m2;
}
```

Now, which m1 is being used on `#bar`? Before order dependence, the answer would be simple: It was m1-bottom, and the element would be violet. But now we have to decide whether the important part is what the outermost `@apply` says, or if it's what is being seen in `--m2` (which only sees m1-top). If it's the former, it is inconsistent with `#foo` (which certainly would see only m1-top, if order dependence is to matter at all). If it's the latter, we can have multiple different `--m1` in play at any time (goodbye incremental overwriting of the mixin map), even within the same call stack (does that influence cycle detection?).

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12670 using your GitHub account


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

Received on Thursday, 28 August 2025 10:35:13 UTC