Re: [csswg-drafts] [css-cascade] Where do "custom origins" fit in the cascade? (#5003)

The CSS Working Group just discussed `Where do "custom origins" fit into the cascade`.

<details><summary>The full IRC log of that discussion</summary>
&lt;Rossen_> Topic: Where do "custom origins" fit into the cascade<br>
&lt;Rossen_> github: https://github.com/w3c/csswg-drafts/issues/5003<br>
&lt;myles> miriam: 503 was me starting to think through where it might fit. I propose here in the issue it could be nested under scoping, though TabAtkins raised a question around the use cases in a different issue that would contradict that. I'm not sure the proposal her fits every use case.<br>
&lt;dbaron> s/503/5003/<br>
&lt;astearns> tab's comment: https://github.com/w3c/csswg-drafts/issues/4981#issuecomment-621975440<br>
&lt;myles> miriam: In this proposal, I was thinking for most of these use cases like a layering of a framework, a theme, design system, component, it wouldn't need to be at a high level. TabAtkins pointed out it would need to be to layer new styles over old styles, where you want importance to have more impact<br>
&lt;AmeliaBR> q+<br>
&lt;myles> TabAtkins: You do not want th onion layering inner/outter thing, you want oldstyle normal &amp; oldstyle !important to be together, then you want newstyle normal and newsytle !important to go tobether. This would require reinterpreting what !important means in a custom origin. Styles in the normal case would be importaed as necessary. If you're in a custom origni, you get anew style place that's above origin. !important is a toggle in there that puts you in a new<br>
&lt;myles>  layer<br>
&lt;myles> Rossen: Would `revert` be scoped to the origin<br>
&lt;myles> miriam: It seems `revert` would be useful in this, so that's worth asking.<br>
&lt;myles> TabAtkins: My first thought, i would think we would still want revert to clear the entire author relation. If that's how it's used today, and you migrated to custom origins, it would be bad to have that stop and leak some old styles around.<br>
&lt;myles> TabAtkins: Then i'm not super clear on what use cases there would be to clear out the styles just form one custom origin<br>
&lt;myles> Rossen: I'm thinking of forced colors, overrides that are there for UA reasons<br>
&lt;myles> Rossen: today they revert all the way back. If we only did that in a custom origin, like you said, that would lead to a lot of weird other styles<br>
&lt;myles> florian: If one of your layers is a reset, using revert to go back to the revert isn't crazy<br>
&lt;fantasai> +1 to jensimmons<br>
&lt;myles> jensimmons: Maybe we need two different controls. One that lets you go back all the way, and one that lets you go back to just one layer<br>
&lt;dbaron> +1 to jensimmons on multiple reverts<br>
&lt;AmeliaBR> +1 to Jen's comment; both use cases are valid<br>
&lt;myles> fremy: I recently on twitter I was a thread with a company misunderstanding `revert` or `initial` and people trying to explain it, and it was still wrong. We need to stop worrying about how many reverts and initial because eventually people are not going to undersatnd it any more<br>
&lt;myles> miriam: Authors got the idea that initial would work more like revert does, and were used to it before revert became available. Authors are using initial thinking it takes them to browser defaults, and it doesn't.<br>
&lt;myles> TabAtkins: That's why the keyword we have, ignoring future keywords, should do the same it does today, so it can do the same thing to does today of reverting to the UA stylesheet<br>
&lt;myles> florian: Today we can't determine the difference between "going back to the browser" and "blowing away all user styles"<br>
&lt;myles> TabAtkins: It should blow away all the styles in the world of custom origins<br>
&lt;myles> jensimmons: Avoiding complexity is a value that we hold and should apply, so maybe revert-foobar and that is the more precise tool, and just revert as we have it today blows everything away<br>
&lt;myles> jensimmons: That makes sense to me<br>
&lt;Rossen_> q?<br>
&lt;fremy> (correcting the minutes a bit, I think we need to *start* worrying about how many "revert"-like keywords we have)<br>
&lt;myles> florian: One question: Now we're xploring whether custom origins should be per origin or something in between .... is there a specific problem here? Why are we looking into alternatives?<br>
&lt;TabAtkins> qq+<br>
&lt;TabAtkins> (I do have an asnwer to that question)<br>
&lt;myles> miriam: I wasn't here for the initial conversation, so I was going off the notes. There were issues raised in that thread. I wasn't there for that thread. it also seemed like maybe we could avoid the issues with imiportance and scoping shadow dom. SO i was looking into that. I don't have a strong reason for that.<br>
&lt;Rossen_> ack TabAtkins<br>
&lt;Zakim> TabAtkins, you wanted to react to a previous speaker<br>
&lt;tantek> present++<br>
&lt;myles> TabAtkins: The reason why using origins might be problematic, in an issue by emilio, shadow dom scopes impose another level between specificity and origins. Right now, that's not too bad because there are only 2 origins today. But if we add more origins, we now have an interleaving of shadow scoping and custom origins. A linear list of things turns into a matrix of specificity complications, which is bad for both authors and implementations. This isn't fatal,<br>
&lt;myles>  but if we could do this below shadow dom scoping, it would help.<br>
&lt;Rossen_> ack AmeliaBR<br>
&lt;tantek> agreed re: specificity has been far too complex for authors, especially teams<br>
&lt;myles> AmeliaBR: The idea of how does this interact with the cascade and importance. It's important to keep this as simple as possible. The biggest author complaint is how complex specificity is and importance, and how you get a lot of unexpected consequences and interactions. keeping this as tightly contained with as few cross interactions as possible is important.<br>
&lt;myles> AmeliaBR: Having this new origin or cascade level whatever it is, completely contain all of its contents so that even if there's an !important rule it's only more important than other things there, that makes sense. If you really want override, then you take a different cascade origin custom origin which is your origin for your override. We don't need to interact them all together.<br>
&lt;florian> q+<br>
&lt;myles> AmeliaBR: Just so its really explicit. Before you have this layering of custom origins as well, so authors are thinking about how these interact intentionally, let's not have interactions that are hard to control<br>
&lt;myles> fantasai: I disagree with ^^^<br>
&lt;Rossen_> ack fantasai<br>
&lt;jensimmons> the !important debate is on https://github.com/w3c/csswg-drafts/issues/4971<br>
&lt;myles> fantasai: I think the origin that we have is really good, and the interaction we have between normal rules and !important have a reverse stacking effect, we do that for scoping right now. For the reasons you want override. If your problem is you want something to have more specificity in a layer, then solve that in that layer. !important is more suited for override. If you want more control over specificity, we can add more control over specificity<br>
&lt;myles> fantasai: Interaction is useful because you can get overriding behavior. Many examples do need that. Like you'll set up a set of base styles, and there are some other rules that make the design work, and those should be !important. These are my slide deck's styles. That's an important feature in the custom cascade origins.<br>
&lt;myles> fantasai: If you think the stack as a level with its own !important next to it, then we can consider a nesting structure, but the override and the inverted priority of !important rules i important in the cascade and it should stay the saem fhere<br>
&lt;Rossen_> ack florian<br>
&lt;myles> florian: I'm in agreement. A lot of the confusion we see about specificifity is that people don't want specificity, but they want custom origins. Specificicity is the wrong tool. People struggle !important because they want specificitity. We should just give them the right tools.<br>
&lt;fremy> (likes what florian said, but it's tricky to get this right I think)<br>
&lt;Rossen_> ack fantasai<br>
&lt;myles> miriam: THis is idealistic, but some idea in my mind that people can learn how importance and origins work from having access to it<br>
&lt;myles> Rossen_: That's novel.<br>
&lt;leaverou> Another reason specificity is confusing is that it's a bad heuristic. It tries to predict importance based on querying logic, and it's frequently wrong (with :not() being a common case of that)<br>
&lt;jensimmons> q+<br>
&lt;myles> fantasai: I like that. I agree with florian. Specificifity is arbitrary. it doesn't always owrk. There are features that people want such as origins and scoping int he cascade. "The stuff here always wins over the stuff that's defined for the page as the whole" so peole try to do this with specificity but it's not strong ehough.<br>
&lt;TabAtkins> Proposal for this issue: https://github.com/w3c/csswg-drafts/issues/4981#issuecomment-622090790<br>
&lt;myles> Rossen: A lot of the conversation is around reaffirming the fact that we do want custom origins and we want to get them wroking. This is another confirmation based on jensimmons's awesome demo and talk back in the real F2F in january.<br>
&lt;myles> Rossen: The actual current topic is "where do they fit?" Can we make some decision here?<br>
&lt;florian> q+<br>
&lt;myles> Rossen: We need something more concrete to play with<br>
&lt;TabAtkins> q+ to talk about the comment<br>
&lt;Rossen_> s/novel/nobel/<br>
&lt;myles> jensimmons: There is a debate to be had about how !important works. It's ticket 4971<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack jensimmons<br>
&lt;myles> jensimmons: I want to switch to 4969. Where do custom origins fit reminds me of a conversation I had with miriam a couple weeks ago<br>
&lt;myles> jensimmons: (custom origins aren't my idea, i just got to present them)<br>
&lt;myles> jensimmons: It was a conversation about 4969<br>
&lt;castastrophe> https://github.com/w3c/csswg-drafts/issues/4969<br>
&lt;myles> Rossen: before we switch topics, this is going to get dumped into a different issue. But we have a queue. Let's flush the queue. I agree this is more of a umbrella feature issue rather than .... [missed]<br>
&lt;myles> florian: TabAtkins earlier said that shadow dom is a source of complexity. Is there a way to recast the current shadow dom thing into custom origins once we have them, so we owuldn't need two layers, and just merge them and stop worrying about hte interaction?<br>
&lt;Rossen_> ack *<br>
&lt;Rossen_> ack florian<br>
&lt;Rossen_> ack TabAtkins<br>
&lt;Zakim> TabAtkins, you wanted to talk about the comment<br>
&lt;myles> TabAtkins: We can't reasonably recast existing shadow dom styling into custom origins. The interaction is "outer styles that get put in via ::part pseudos vs the styles that are defined inside the shadow root"<br>
&lt;myles> TabAtkins: Given there's infinite nesting, it's not possible to recast in terms of custom origins<br>
&lt;myles> AmeliaBR: On this topic, this issue, where do they fit in the cascade. We had agreement that there's a natural cascade when it comes to comparing with browser and user styles and !important, but shadow dom is the complication, and the other one is animations and transitions, where are currently defined in terms of a separate origin that overrides<br>
&lt;myles> AmeliaBR: That's another weird set of possible interactions that needs to really be written out and the shadow dom thing neesd to be written out so the use cases are logical for shadow dom especially, there are very clear use cases of defaults and overrides, and these need to interact in a useful way.<br>
&lt;myles> Rossen: These are great additions to things that need to be taken into account.<br>
&lt;myles> Rossen: I want us to move forward and make progress on other issues.<br>
&lt;myles> Rossen: we have about 20 minutes remaining here for custom origins.<br>
&lt;myles> Rossen: We barely started making any progress<br>
&lt;myles> Rossen: jensimmons wanted us to go to 4969<br>
&lt;myles> jensimmons: yes<br>
&lt;myles> jensimmons: it's a big chunk<br>
&lt;TabAtkins> Agree that we should hit the various issues to bring the talking points into people's heads; we shouldn't expect final progress on this here at this meeting.<br>
</details>


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

Received on Thursday, 30 April 2020 20:34:24 UTC