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`.

<details><summary>The full IRC log of that discussion</summary>
&lt;ntim> miriam: We've discussed this before, authors have been asking for ways to explicit place their styles cascade layer order<br>
&lt;ntim> Miriam: The other way to think about that, is that people want to have layers above their unlayered styles<br>
&lt;ntim> miriam:  after different proposals, we sorted them into 3 categories<br>
&lt;miriam> https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-2207341923<br>
&lt;ntim> miriam: one was an explicit name for unlayered styles<br>
&lt;ntim> miriam: one was an explicit naming convention for putting your styles above unlayered styles<br>
&lt;ntim> miriam: starting with a bang, up or down<br>
&lt;ntim> miriam: the third was some explicitly prenamed layer that uses a special layer<br>
&lt;ntim> miriam: we rejected the first option<br>
&lt;ntim> miriam: in the discussion, we realized that options 2 &amp; 3 are the same but with different names<br>
&lt;bramus> q+<br>
&lt;ntim> miriam: what the issue thread came to was option 2<br>
&lt;emilio> q+<br>
&lt;ntim> miriam: the proposal was that layers can start with a hash, and they would go above<br>
&lt;ntim> miriam: hash because they don't work like importance<br>
&lt;TabAtkins> +1<br>
&lt;hober> q+<br>
&lt;ntim> miriam: spelling can be discussed further if needed<br>
&lt;ntim> miriam: but the gist is that layers can be named differently and they would go above<br>
&lt;astearns> ack bramus<br>
&lt;oriol> q+<br>
&lt;kbabbitt> q+<br>
&lt;ntim> bramus: big +1, author requests all over the place, personal pref is not using the hash, but to use ! to denote that it's a strong layer.<br>
&lt;ntim> bramus: the argument for hash is that it's an ID, but layers already have a name<br>
&lt;astearns> ack emilio<br>
&lt;ntim> emilio: this looks reasonable, but I wonder, what is the order of these layers relative to each other?<br>
&lt;astearns> ack hober<br>
&lt;ntim> emilio: seems fine, i don't care too much about syntax<br>
&lt;ntim> hober: I like solving the use case, I have 2 issues with syntax<br>
&lt;ntim> hober: the first is that the hash seems particularly, hash is linked to fragments<br>
&lt;ntim> hober: more broadly, I like naming conventions for author, but I don't like naming conventions that the platform imposes<br>
&lt;fantasai> +1<br>
&lt;ntim> hober: I'd rather have syntax that doesn't intrude into names<br>
&lt;astearns> ack oriol<br>
&lt;ntim> oriol: I wanted to say that this hash sign seems too related to ID selectors, I'm not advocating for ! necessarily, but hash seems weird<br>
&lt;ntim> oriol: would that just be for named layers? would it be possible to have an unnamed layers over named ones?<br>
&lt;ntim> miriam: this hasn't been discussed<br>
&lt;astearns> ack kbabbitt<br>
&lt;kbabbitt> ^<br>
&lt;ntim> kbabbitt: I support the proposal, I would prefer not using hash, fantasai proposed a slash<br>
&lt;ntim> miriam: the slash proposal is quite different, and it gets complicated, and it would be simpler if it stayed in the name<br>
&lt;ntim> fantasai: not sure I understood that, it would work the same as !<br>
&lt;ntim> fantasai: you could declare I have 2 layers that go above, 2 layers that go below, pretty easily with slash<br>
&lt;bramus> q+<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to suggest https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-971910037<br>
&lt;ntim> fantasai: and if you want to do only 1, you can just prefix with the slash<br>
&lt;kbabbitt> s/^/I'll also suggest ^ as an alternative to #/<br>
&lt;astearns> ack bramus<br>
&lt;fantasai> @layer / bar { stuff }<br>
&lt;ntim> fantasai: thinking about it as a syntax, rather than as an attachment to the name, would give more flexibility<br>
&lt;ntim> bramus: in prev discussions we had, there was a remark that we didn't want to introduce random ASCII characters to denote special things, so I'd rather want to stick to pre-existing ones like hash or !<br>
&lt;bramus> q+<br>
&lt;fantasai> s/syntax/separate syntax/<br>
&lt;astearns> q+<br>
&lt;kbabbitt> between # and ! I would prefer !<br>
&lt;ntim> bramus: when referring to nested layers, you can use the . notation, with the slash, I don't see how that would work<br>
&lt;astearns> ack bramus<br>
&lt;astearns> ack astearns<br>
&lt;ntim> bramus: whereas with the # / !, it would work, bc it sticks with name<br>
&lt;ntim> astearns: in my quick reading of the slash proposal, I was confused<br>
&lt;astearns> I was assuming lists would look like `above / unlayered / below`<br>
&lt;ntim> fantasai: this is what I had in mind<br>
&lt;ntim> fantasai: actually it's the other way round<br>
&lt;astearns> so it’s `below / unlayered / above`<br>
&lt;astearns> `name/` `/name`<br>
&lt;ntim> astearns: if we used slash, or any other char, do we have different behavior if it comes before or after?<br>
&lt;ntim> miriam: I think with fantasai's proposal you'd get a bit of that<br>
&lt;astearns> q?<br>
&lt;ntim> astearns: with fantasai's proposal, we're always building a list<br>
&lt;ntim> miriam: in the issue, i thought we had consensus, we can take it back to the issue?<br>
&lt;bramus> q+<br>
&lt;astearns> q+<br>
&lt;ntim> miriam: I tend to agree with bramus, that we lose a lot of flexibility around syntax, for the reasons stated previously<br>
&lt;ntim> fantasai: why can't you do this with slash?<br>
&lt;miriam> @layer #name { … } vs @layer / name { … }<br>
&lt;ntim> fantasai: I might not be understanding this well, but would exclamation at the start/end be the same thing?<br>
&lt;astearns> ack bramus<br>
&lt;fantasai> this: https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-2433062569<br>
&lt;ntim> bramus: !important exists, it works in weird ways, it's considered a design mistake, but it's there so maybe we should embrace it<br>
&lt;kizu> q+<br>
&lt;fantasai> but I might have misunderstood it<br>
&lt;ntim> bramus: a lot of the authors don't understand the cascade well, if we use the exclamation point to denote strong layers, then authors could make the link<br>
&lt;ntim> miriam: I agree with that except the conclusion. We can't brush away the fact that they don't understand layers. So we have to teach them properly importance<br>
&lt;astearns> ack astearns<br>
&lt;ntim> miriam: we shouldn't confuse that for users, because they work very differently<br>
&lt;ntim> astearns: I want to disagree with the point made about avoiding random ASCII. It's not to avoid re-using random ASCII, but rather to make things explicit with words<br>
&lt;ntim> dbaron: and a word you can search for<br>
&lt;astearns> ack kizu<br>
&lt;ntim> kizu: one thing I want to mention, we can probably resolve on choosing option 2 about adding _something_ to the name<br>
&lt;bramus> +1<br>
&lt;miriam> I'd be happy with the caret<br>
&lt;astearns> s/avoiding random ASCII. It's not to avoid re-using random ASCII/avoiding adding random ASCII. It’s not that we should re-use existing random ASCII/<br>
&lt;bramus> Not blocking on caret<br>
&lt;ntim> kizu: I would prefer the current symbol, to avoid overloading symbols<br>
&lt;fantasai> s/current/caret/<br>
&lt;ntim> kizu: ! often denotes negation in other languages too, in addition to the current meaning in CSS<br>
&lt;bramus> As long as it’s not the #, I’m fine :)<br>
&lt;hober> q+<br>
&lt;ntim> astearns: ^ might be something to start with<br>
&lt;astearns> ack hober<br>
&lt;lea> Q+<br>
&lt;ntim> fantasai: caret also points up<br>
&lt;ntim> hober: caret as syntax vs caret as name?<br>
&lt;ntim> hober: in the CSSOM, I don't want the caret in the name if I ask for the name<br>
&lt;lea> Q?<br>
&lt;ntim> miriam: i'm ok with that, but adding a space might make it complicated for nested<br>
&lt;ntim> TabAtkins: we need the caret to distinguish right?<br>
&lt;ntim> hober: how about a function syntax?<br>
&lt;bramus> qq+<br>
&lt;TabAtkins> `@layer foo, ^foo;`is valid<br>
&lt;TabAtkins> need to be able to tell them apart<br>
&lt;fantasai> ok, can we not have separate namespaces?<br>
&lt;ntim> miriam: the issue that Tab was getting at, if we put a layer in the name foo, and one outside name foo. We have no way to distinguish them<br>
&lt;fantasai> I think that's not a good idea<br>
&lt;ntim> hober: maybe that would be good because it would encourage explicit names<br>
&lt;ntim> TabAtkins: but then you can't declare<br>
&lt;ntim> miriam: it's very common to declare<br>
&lt;astearns> ack bramus<br>
&lt;Zakim> bramus, you wanted to react to hober<br>
&lt;ntim> bramus: I agree that the caret shouldn't be part of the name when reading it back, but it should expose it through an attribute in CSSOM<br>
&lt;bramus> An attribute on CSSLayerBlockRule<br>
&lt;astearns> @layer foo(strong)<br>
&lt;TabAtkins> point of order, maybe? this is just us bikeshedding over syntax space we've already spent time bikeshedding over in previous meetings. we had previously reached a reasoanble consensus and just needed to decide a final detail.<br>
&lt;astearns> ack lea<br>
&lt;ntim> lea: it seems like we're converging towards caret. Why are we optimizing for conciseness? Any symbol will be less explicit than an explicit description. What if we add more ways to control layers?<br>
&lt;ntim> lea: if we follow this pattern, are we going to explode syntax?<br>
&lt;ntim> lea: I'd prefer an explicit named description<br>
&lt;dbaron> +1 (weakly, at least) to keywords or functions rather than symbols<br>
&lt;ntim> miriam: I don't think it's true that there's a lot of possible expansions, including for shadow DOM<br>
&lt;ntim> miriam: shadow DOM cascading happens before layer cascading<br>
&lt;ntim> miriam: we likely need something completely new<br>
&lt;ntim> miriam: layers as a feature exists in the cascade after shadow contents in teh cascade<br>
&lt;ntim> miriam: there is no way for stuff internal to layering that would impact something external to layering (like shadow DOM)<br>
&lt;ntim> lea: this is about what other ways of ordering we may want to define? not about a specific proposal<br>
&lt;ntim> miriam: I don't think there's any other ones internal to layering<br>
&lt;ntim> fantasai: I'm basically agreeing with miriam that this idea of concept of above/below always existed, just without a syntax<br>
&lt;ntim> fantasai: it's a feature much more fundamental, so I think it's ok if the syntax very baked<br>
&lt;TabAtkins> you do that by just not using a layer<br>
&lt;ntim> lea: is there any point at defining a layer at the same level?<br>
&lt;ntim> astearns: I don't think there is consensus, there are a bunch of new ideas. There's objection around re-using the chars. We need to go back to the issue<br>
&lt;ntim> miriam: we have done this many times, and keep rehashing the same discussions<br>
&lt;bramus> +1<br>
&lt;kizu> +1<br>
&lt;ntim> miriam: when we do reach consensus on the issue, we have new people coming up with the same discussions<br>
&lt;ntim> TabAtkins: we need to resolve on something.<br>
&lt;ntim> hober: a resolution would probably fail right now<br>
&lt;ntim> astearns: the only thing that we might be able to resolve on is the caret<br>
&lt;ntim> TabAtkins: is everyone ok with the exact proposal from miriam?<br>
&lt;ntim> hober: idk<br>
&lt;TabAtkins> save with ^ isntead of #<br>
&lt;ntim> astearns: use a single character in front of the name was the proposal<br>
&lt;ntim> hober: the question about whether the symbol is part of the name is very relevant<br>
&lt;ntim> hober: it's the contentious part of this<br>
&lt;ntim> miriam: is this only for CSSOM?<br>
&lt;ntim> hober: it's more general<br>
&lt;ntim> miriam: it would be attached to the name, like the dot is for nested layer<br>
&lt;bramus> s/it would be attached to the name, like the dot is for nested layer/it would be attached to the name, like the dot is for a classname<br>
&lt;ntim> miriam: so you couldn't have a strong/weak version with foo<br>
&lt;ntim> astearns: if it's not part of the name, and we restrict layer names to non-conflict names (strong or weak), we need some kind of processing rule<br>
&lt;ntim> miriam: this would be a new rule<br>
&lt;ntim> emilio: conflicting names with conflicting strongness, what happens there?<br>
&lt;ntim> hober: I could live with overriding<br>
&lt;ntim> miriam: neither of the options are desirable, why are we doing this?<br>
&lt;ntim> hober: we shouldn't mess with semantics of author defined names<br>
&lt;ntim> hober: double dash was a hack<br>
&lt;ntim> miriam: what do we gain from this ?<br>
&lt;bramus> `CSSLayerBlockRule.attributeThatIndicatesIfItsStrongOrNot = true | false`<br>
&lt;ntim> astearns: I would like the CSSOM discussion to be separate from this issue<br>
&lt;ntim> hober:This is about semantics more fundamentally, not just CSSOM<br>
&lt;ntim> astearns: we are done with this discussion<br>
&lt;bramus> :(<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-2627810047 using your GitHub account


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

Received on Friday, 31 January 2025 16:58:10 UTC