Re: [csswg-drafts] [css-mixin-1] How does Shadow DOM influence mixin lookup? (#12671)

Example of the main question in this issue:

```html
<style>
  @mixin --m() {
    --x: 1;
  }
</style>
<div id=host>
  <template shadowrootmode=open>
    <style>
      #inner {
        @apply --m(); /* --x? */
      }
    </style>
    <div id=inner></div>
  </template>
</div>
<style>
  @mixin --m() {
    --x: 2;
  }
</style>
```

I'd rather not introduce an order dependence concept so strong that we need to "understand" the styles in the shadow according to whatever the environment "was" at the point/time where the host lives ...

I guess we can limit the order dependence _per tree_, and then lookup _between_ trees happen the usual way?

> Similarly, what can adopted style sheets see? Can they provide mixins?

Adopted stylesheets must already have some reasonably well-defined order, so I'd assume yes.

> If an adopted style sheet with an `@apply` is used in both the parent and the shadow, does that mean it can see different mixins in each?

I guess they could see different mixins, yeah.

-- 
GitHub Notification of comment by andruud
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12671#issuecomment-3233455422 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 13:12:35 UTC