Re: [csswg-drafts] [css-cascade][css-scoping] Allow layers to use different names in different contexts (#10091)

It might be more useful to allow a generic way to create an alias of a layer name. It doesn't necessarily need to be tied to contexts.

```css
@layer reset as base;
```

This would be useful even without shadow DOM, especially when working with third-party stylesheets that have their own layer names. For example, `tailwindcss` v4 preconfigures `base` and `utilities` as layer names and you might want to merge those layers with your own layers (which probably have different names).

This same concept can be applied to shadow contexts by nesting the layer alias statement inside a selector (making the `in` syntax redundant).

```css
:host(one-element) {
  @layer defaults as reset;
}
:host(another-element) {
  @layer defaults as base;
}
```

I'm not sure if this fits into your proposal or should be its own separate thing, but I just wanted to mention it while it's still fresh in my mind.

-- 
GitHub Notification of comment by mayank99
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10091#issuecomment-2043406913 using your GitHub account


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

Received on Monday, 8 April 2024 18:26:43 UTC