Re: [csswg-drafts] [css-cascade] Proposal: `@layer initial` should always be the first layer (#10094)

@mirisuzanne Thanks for looking into this. If you think this idea has legs, should I open a new issue specifically for `@context`?

> But if styles can be added to a first/last context from either the light or shadow DOM… does their originating context still come into play? Or do we now ignore the shadow/page context, and conflicts within first/last have to continue in the cascade?

I want to say the originating context should not matter because it's a totally different context. The alternative would be that `@context` styles added from the innermost shadow context would cascade first.

In https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-2181121893, I was also wondering if maybe `@context` should not be allowed to be used from shadow context. This sidesteps some of harder questions and can be reasoned about since the shadow styles are already in a fully encapsulated special context. Although, I think it would be confusing if some CSS features literally did not work in shadow DOM.

> As a solution to static top/bottom layers… I would rather see that built into the `@layer` rule.

We could also have something built into `@layer`. The `@context` proposal does not *have* to replace my `@layer initial` proposal and some of the `!overrides` syntaxes proposed in #6323.

> I do see the additional use of specifying something akin to presentational-hints, but in my mind this confuses the current meaning of a `context`, since styles would now move across contexts no matter where defined?

I only picked "context" because it seems like the right layer (no pun intended) to place "first"/"last" styles. What would be other ways of solving the problem I described in my [earlier comment](https://github.com/w3c/csswg-drafts/issues/10094#issuecomment-2179369415)? Is it possible to make `@layer initial` cascade before the shadow context? Maybe `@layer initial` should actually refer to the presentational-hints layer?

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


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

Received on Wednesday, 26 June 2024 02:05:37 UTC