Re: [csswg-drafts] [css-cascade-5] Allow authors to explicitly place unlayered styles in the cascade layer order (#6323)

My concern here is that a layer (whether named or anonymous) that is not accounted for in the first statement that mentions `initial` has no way to pull itself ahead of the unlayered rules. We decided to have a default behavior, and that's fine, but you can't actually change the default behavior without naming the layer and listing it at the top of the file. We decided not to require all layers to be named up front, so I think wanting a different default behavior for layer precedence shouldn't impose that requirement.

Also, in every other case, if you take a bunch of separate CSS files containing @layer rules and combine them into a single file, they behave the same way as if you imported them in that order, as long as you avoid naming clashes. But `initial` is guaranteed to name-clash, so treating it as just a regular layer with an automatic name ends up means it's effectively ignored in later rules, and that breaks this invariant.

Nesting is not a solution to this problem because you might want all of the unlayered styles to cascade together. Nesting is not merely a namespacing mechanism, it changes the cascade also.

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


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

Received on Tuesday, 19 October 2021 20:00:29 UTC