[csswg-drafts] Pull Request: [css-cascade-5] Clarify the scope of layers

cdoublev has just submitted a new pull request for https://github.com/w3c/csswg-drafts:

== [css-cascade-5] Clarify the scope of layers ==
I.e. the scope is origin and context, as noted [before](https://drafts.csswg.org/css-cascade-5/#cascade-layering) the updated text:

  > Declarations within **each origin and context** can be explicitly assigned to a cascade layer.
  
In my opinion, an example would help to better capture what this means:

  > Given the following markup:
  >
  > ```html
  > <style>
  >   @layer one { p::after { content: 'one wins' } }
  >   @layer two { p::after { content: 'two wins' } }
  > </style>
  > <p>Result: </p>
  > <div>
  >   <template>
  >     <style>
  >       @layer two { p::after { content: 'two wins' } }
  >       @layer one { p::after { content: 'one wins' } }
  >     </style>
  >     <p>Result: </p>
  >   </template>
  > </div>
  > ```
  >
  > The `@layer` statement does not affect the `@layer` rules declared in the shadow tree. 
  >
  > In the light tree, the result is `two wins`. In the shadow tree, it is `one wins`.

See https://github.com/w3c/csswg-drafts/pull/13690


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

Received on Friday, 20 March 2026 07:44:06 UTC