Re: [csswg-drafts] [css-cascade-5] Do conditional rules impact layer order? (#6407)

The CSS Working Group just discussed `https://github.com/w3c/csswg-drafts/issues/6407`, and agreed to the following:

* `RESOLVED: Layer rules respect conditionals, and are ignored in non-global conditionals.`

<details><summary>The full IRC log of that discussion</summary>
&lt;Rossen_> topic: https://github.com/w3c/csswg-drafts/issues/6407<br>
&lt;Rossen_> github: https://github.com/w3c/csswg-drafts/issues/6407<br>
&lt;TabAtkins> miriam: what happens when layers are defined inside of conditionals?<br>
&lt;TabAtkins> miriam: like @media ... { @layer ...; }<br>
&lt;TabAtkins> miriam: Do those layers contribute to layer order, and if so, how?<br>
&lt;TabAtkins> miriam: In the final thread comment i listed the options<br>
&lt;TabAtkins> miriam: First is parse error - don't think that works.<br>
&lt;TabAtkins> miriam: Like what happens when we apply a media to an entire stylesheet? Doesn't seem right to ahve layers disappear.<br>
&lt;TabAtkins> miriam: Second is layers in conditionals don't contribute to the order. This has similar issues - what if a layer *only* appears inside a conditional? Still need some order for them.<br>
&lt;TabAtkins> miriam: So remaining is (3) layers always contribute in order they appear, whether the conditional is matched or not<br>
&lt;TabAtkins> miriam: I think this is my favorite solution, bc it doesn't require special casing<br>
&lt;TabAtkins> miriam: Last solution is to make layer ordering dynamic based on conditionals<br>
&lt;TabAtkins> miriam: In some ways this is true already via (3) with media="" attribute, due to lazy-loading, so you'll get some dynamic behavior anyway<br>
&lt;TabAtkins> miriam: This would just go all the way<br>
&lt;TabAtkins> miriam: It'll need special casing for container queries; they don't have a global match state, they're matched per element. They'd have to fall back to the first or second option there.<br>
&lt;TabAtkins> TabAtkins: I was originally for option 3, but lazy loading made me reconsider, so now I'm strong for option 4 (with ignoring layers in @container rules)<br>
&lt;TabAtkins> TabAtkins: And emilio was also for 4 on Twitter, and it looks like Anders is for 4 from the issue thread<br>
&lt;TabAtkins> miriam: The Twitter thread also voted for 4 by far. (Not always right, but it's useful info about what authors expect.)<br>
&lt;futhark> q+<br>
&lt;TabAtkins> miriam: I think 3 is simpler to udnerstand and teach, but I see the points for 4.<br>
&lt;TabAtkins> miriam: Fine with either way.<br>
&lt;Rossen_> ack futhark<br>
&lt;TabAtkins> futhark: NOt just lazy loading, also inserting stylesheets and rules. You can insert layer rules dynamically, right?<br>
&lt;TabAtkins> miriam: yeah<br>
&lt;TabAtkins> futhark: So I think that leans toward fully dynamic as well, since other things cause similar dynamic results<br>
&lt;TabAtkins> Rossen_: So I'm hearing pretty strong support for 4 among authors and impls. Are you okay with that, Miriam?<br>
&lt;bkardell_> +1<br>
&lt;TabAtkins> miriam: sure<br>
&lt;TabAtkins> Rossen_: Any objections?<br>
&lt;TabAtkins> RESOLVED: Layer rules respect conditionals, and are ignored in non-global conditionals.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6407#issuecomment-871547852 using your GitHub account


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

Received on Wednesday, 30 June 2021 16:23:48 UTC