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

The CSS Working Group just discussed `[css-cascade-5] Allow authors to explicitly place unlayered styles in the cascade layer order`, and agreed to the following:

* `RESOLVED: Reject option 1`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> miriam: since we introduced layers, we intentionally made them weaker than unlayered styles<br>
&lt;TabAtkins> miriam: this is useful for importing third-party code, if they use layers you should be able to determine if they override you or not<br>
&lt;TabAtkins> miriam: but authors would like a way to be more explicit, there are some cases where it woudl be helpful to import unlayered and override them<br>
&lt;TabAtkins> miriam: there are cases where you're getting styles from a third party that you can't layer<br>
&lt;TabAtkins> miriam: difficult to solve. three approaches that have come up in various forms<br>
&lt;TabAtkins> miriam: if we could at least narrow on the appraoch we could bikeshed the syntax<br>
&lt;emilio> q+<br>
&lt;TabAtkins> miriam: 1) somehow say in your layer ordering, give a special name to the unlayered styles and let you put it in yourself<br>
&lt;TabAtkins> miriam: conceptually simplest, but now different stylesheets can disagree about position. once you set it once, later things can't move it around. so styles can't palce themselves in relation.<br>
&lt;TabAtkins> miriam: think we shoudl take it off the table<br>
&lt;TabAtkins> miriam: other two are variants<br>
&lt;TabAtkins> miriam: 2) with each layer, say whether it's above or below the unlayered styles<br>
&lt;TabAtkins> miriam: ideally make that clear in the layer name itself<br>
&lt;TabAtkins> miriam: maybe a !<br>
&lt;TabAtkins> miriam: downside is now we're trakcing two layer lists separately, a little complicated mentally<br>
&lt;TabAtkins> miriam: mayb ealso impl complicated, unsure<br>
&lt;bramus> I like to call these “strong layers”<br>
&lt;TabAtkins> miriam: 3) simplification of that, one named layer that's above and you can add sublayers to that<br>
&lt;bramus> q+<br>
&lt;TabAtkins> miriam: call it !top or something, you can write `@layer !top { @layer my-foo {...}}`<br>
&lt;TabAtkins> miriam: that seems in some ways a good balance of the tradeoffs<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: i agree we don't want #1<br>
&lt;emilio> https://github.com/w3c/csswg-drafts/issues/6466<br>
&lt;TabAtkins> emilio: this also interacts with this issue (above)<br>
&lt;TabAtkins> emilio: where one potential option was letting unlayered styles compete by specificity across scopes<br>
&lt;TabAtkins> emilio: i dont' think this has been discussed yet, but it's similar-ish<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> (I don't think this touches directly on the slotted stuff, even if we end up having to define a similar solution)<br>
&lt;TabAtkins> bramus: big +1 on solving this, authors are struggling with it<br>
&lt;kizu> q+<br>
&lt;TabAtkins> bramus: i lean towards option 2, has some identifier added to the layer name indicating it's a "strong" layer<br>
&lt;TabAtkins> bramus: ! is fine, whatever<br>
&lt;TabAtkins> qq<br>
&lt;TabAtkins> q+<br>
&lt;TabAtkins> bramus: with the ! you can add a strong layer into a non-strong layer<br>
&lt;TabAtkins> astearns: do we allow ! in layer names right now?<br>
&lt;fantasai> +1 to bramus<br>
&lt;keithamus> q+<br>
&lt;TabAtkins> TabAtkins: no, they're idents<br>
&lt;astearns> ack kizu<br>
&lt;TabAtkins> kizu: big +1<br>
&lt;TabAtkins> kizu: i'm for third option<br>
&lt;TabAtkins> kizu: second can be a bit confusing, because ordering layers is odd if you mix layers with ! and without<br>
&lt;TabAtkins> kizu: I think just giving each layer a !top layer is simplest to implement and understand<br>
&lt;TabAtkins> kizu: use-cases for this probably isn't that many, so only having one !top per layer is fine imo<br>
&lt;TabAtkins> kizu: and each layer has its own seaprate !top<br>
&lt;fantasai> scribe+<br>
&lt;astearns> ack TabAtkins<br>
&lt;fantasai> TabAtkins: I also now think #3 is best, because ordering problem where the "below" styles and the "above" styles are tracked in the same layer declaration and multiple declarations stack<br>
&lt;fantasai> TabAtkins: that induces a misordering, where you have regular, !strong, regular, !strong -- look like they're in a single list but interwoven<br>
&lt;bramus> q+<br>
&lt;fantasai> TabAtkins: having an explicit layer avoids this issue, nothing gets reordered in an implicit way<br>
&lt;astearns> zakim, close queue<br>
&lt;Zakim> ok, astearns, the speaker queue is closed<br>
&lt;astearns> ack keithamus<br>
&lt;TabAtkins> keithamus: at github we just shipped layers, we ran into this issue so big +1<br>
&lt;romain> q+<br>
&lt;TabAtkins> keithamus: i think option 3 works, option 2 is a little onfusing, option 1 sin't great<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: making sure i udnerstand<br>
&lt;TabAtkins> fantasai: option 2 is the name, depending on ! or not, grows the layer order away from teh unlayered<br>
&lt;TabAtkins> miriam: no they both get strong<br>
&lt;TabAtkins> fantasai: okay so two lists<br>
&lt;TabAtkins> fantasai: and #3 is the same but the top list has a name<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> Note my example: `@layers foo bar !baz qux;`<br>
&lt;TabAtkins> bramus: replying to Tab about mixing layers<br>
&lt;TabAtkins> bramus: could say that when defining, can't intermix<br>
&lt;fantasai> fantasai: Ok, in that case I would prefer #2. Prefer that to having a magic name.<br>
&lt;TabAtkins> bramus: so only `@layers foo bar; @layers !baz !qux;`<br>
&lt;TabAtkins> miriam: can we reject option 1 at least?<br>
&lt;TabAtkins> astearns: objections?<br>
&lt;romain> +1<br>
&lt;TabAtkins> RESOLVED: Reject option 1<br>
&lt;TabAtkins> Note that "just don't allow mixing in the same statement" is more complicated than it looks.<br>
</details>


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


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

Received on Wednesday, 23 October 2024 17:04:57 UTC