W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2020

Re: [csswg-drafts] [css-cascade] What are the proper "levels" for managing Cascade Layers? (#4969)

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Mon, 27 Jul 2020 23:55:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-664697335-1595894147-sysbot+gh@w3.org>
The CSS Working Group just discussed `[css-cascade] What are the proper "levels" for managing Cascade Layers?`.

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: [css-cascade] What are the proper "levels" for managing Cascade Layers?<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/4969<br>
&lt;dael> chrishtr: I can summarize the latest update<br>
&lt;TabAtkins> q+<br>
&lt;dael> chrishtr: Discussed at previous F2F. I prop we start with simplest set of layers; 2. Base between UA and regular stylesheets and then regular stylesheets. Allows simple use case where you import a widget. You can define what's important to the widget and would break without and than use those customizable.<br>
&lt;dael> chrishtr: 3rd part dev marks what's important and can't be overwritten. Then with normal cascade if they want to override not required they put in their own rule to change.<br>
&lt;dael> Rossen_: Allow library or component authors to provide sensible defaults and allow consumers...<br>
&lt;dael> chrishtr: To customize properties that are appropriate to customize<br>
&lt;Rossen_> q?<br>
&lt;dael> chrishtr: We tried to make this polyfillable so that existing websites like nextJS could with small dev effort translate existing layers into an ordering of stylesheets on the page and the specificities that are eq.<br>
&lt;dael> chrishtr: Then sites could use right away in build steps until browsers finish impl<br>
&lt;dael> Rossen_: How does multiplicity here have anything additional against this? More than 2 layers?<br>
&lt;dael> chrishtr: How would that make it harder?<br>
&lt;dael> Rossen_: Yeah<br>
&lt;miriam> q+<br>
&lt;dael> chrishtr: Maybe there isn't a good reason other than 2 is smallest number. Kind of a joke, kind of not. Good principle to find smallest solution. Also use cases I've talked to devs about seem completely solved. You have component and site and I"m not sure you have 3 people<br>
&lt;dael> Rossen_: Reasonable. minimum and sufficient. We have lots of talk about how more layers can be used, but I buy this.<br>
&lt;Rossen_> ack TabAtkins<br>
&lt;dael> TabAtkins: Me chrishtr and miriam discussed and drilled pretyt heavy to predefined layers. It's important aspect. At the time we thought we needed 3, but number isn't important. Important is one of the big issues about how to make it make sense if if you you have arbitrary names and ordering you can define those reasonable<br>
&lt;dael> TabAtkins: But as soon as you add otehr libraries with custom layers if you're scoping and interoperate so theither normals go with yoru normals custom names become very difficult. If you have 1 library you can change but with 2 libraries there are too many names.<br>
&lt;dael> TabAtkins: It gets very complex<br>
&lt;dael> TabAtkins: Whereas if we start with a small number of predefined and named layers it lets us solve those issues w'o extra problems. You know what default layer is for and you can import. Everyone using default will use in roughly same way<br>
&lt;dael> TabAtkins: As long as people abide by what the layers mean you'll be able to integrate with 3rd party and they just work.<br>
&lt;dael> TabAtkins: I think that's important aspect that needs to be considered and we should go with for v1 of custom cascade. Having a small number defined hadnles a lot<br>
&lt;Rossen_> q?<br>
&lt;dael> chrishtr: Collapsing layers to 1 at run time is not trivial, miriam brought up. If you don't have polyfill offline it's not easy<br>
&lt;dael> miriam: I'm interested in finding the simpliest poss starting place. Agree a few named defined layers is good to start.<br>
&lt;Rossen_> ack miriam<br>
&lt;dael> miriam: A few concerns with this proposal where it's so focused on polyfill I'm not sure how it's helping. Offhand it supports use cases but doesn't do a lot toward them. Are we solving the problem or focused on polyfill. I don't know that's not sollving the problem<br>
&lt;dael> miriam: One feels to me like it could be a good place to start. The examples rely heavily on !important and where so I'm not sure I see how polyfill is simplier without extra steps<br>
&lt;dbaron> I thought TabAtkins said something above about an import mechanism that collapsed layers, but I didn't see it minuted, and I missed some of the detail of what he said.<br>
&lt;TabAtkins> dbaron, being able to say "import this library's styles, but just treat all of them as living in layer X of my page (while respecting their own internal layer usage)"<br>
&lt;dael> miriam: I also think there's a trade off when we go to predefined layers. It's that we don't get any modularization control which was another potential feature. Ability for final author to modularize by collaposing layers together and say I don't trust bootstrap to get this but can subsume it. It maybe can be handled sep but it's a trade off for same layers<br>
&lt;Rossen_> q?<br>
&lt;dael> fantasai: +1 to miriam<br>
&lt;Rossen_> ack fantasai<br>
&lt;dael> fantasai: I understand desire to make this polyfillable but I think we have not explored what it would look like concretely and take what miriam prop in Jan and make that real.<br>
&lt;dael> fantasai: What she prop is a really powerful system that adds abilities to cascade and authors would find powerful. Simplify to 2 layers is not that compelling. To try and design that would prevent us from trying to understand full picture<br>
&lt;dael> fantasai: At this stage I'd rather explore full context miriam proposed. Then if there is a subset we want to ship first that's fine. But taking on this restrictive set I don't think gives us something to build off of to get where we want to go<br>
&lt;dael> fantasai: Would rather explore original prop from miriam, get that concrete enough to know what it looks like and have specific issues. Shouldn't restrict to polyfillable since the whole point is platform isn't capable of what we want.<br>
&lt;dael> chrishtr: Which use cases not satisfied<br>
&lt;dael> fantasai: Prop is flatten out but when working with multiple systems you'll have all the problems with cascade. Point of this was encapsulate so you don't have specificity of selectors cross interacting. You lose that. If you're losing where for everything you can't control specificity of selectors. Won't have real effect of cascade layer by flattening all selectors<br>
&lt;dael> miriam: Answering it differently it doesn't break any of them but it doesn't go the full way in aiding complexity.<br>
&lt;emilio> q+<br>
&lt;dael> miriam: Something like this scaled back may be useful but I want to see in context of how it would expand. I want to see the whole system and than what a scaled back impl would look like. WHat's the potential to grow and how are we designing first impl so growth is in mind<br>
&lt;dael> chrishtr: Where is only to support polyfills.<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: Using where as polyfill you can do arbitrary layers. THe details of that is not important<br>
&lt;dael> chrishtr: You can have a build tool that sticks thigns in where clause. Laying out what I thought of<br>
&lt;dael> emilio: Most use cases I read about are things conflicting inside same cascade origin. Rather than inventing new ones, sorting order in cascade is specificity and then source. WOuld it make sense to add a 3rd so it's user defined, then specificity, thank source.<br>
&lt;dael> emilio: Multi cascade explodes when you have shadow dom. With this you don't have the problem and solve use cases.<br>
&lt;dael> chrishtr: Would that take care of non-overridable library rules?<br>
&lt;dael> emilio: Potentially. You can define this number is sort of like cascade origins<br>
&lt;dael> miriam: I think difference is only if layers exist above or below shadow dom in cascade which is still open<br>
&lt;dael> emilio: Yeah. And I think this is more efficient to impl<br>
&lt;dael> TabAtkins: I think for spec complexity we'd have to impl this as new specificity.<br>
&lt;miriam> +1<br>
&lt;dael> emilio: Okay, that makes me less scared about perf implications<br>
&lt;Rossen_> q?<br>
&lt;emilio> ack emilio<br>
&lt;Rossen_> ack emilio<br>
&lt;Rossen_> ack dbaron<br>
&lt;dael> dbaron: I was trying to think about something TabAtkins said about an import mech that imports something with stuff from both layers and than collapses<br>
&lt;dael> dbaron: 2 ways to do that and not sure which talking about. One is pretend the layer never existed. Other is sort them in there as though layers and then collapse to one layer<br>
&lt;dael> dbaron: I guess that doesn't work. Now that I said it out loud.<br>
&lt;dael> TabAtkins: My intention was there is a strong case to not interleave but still let the library use layers for code org. Sort the rules specificity wise and then collapse to one layer to interact with yoru pages<br>
&lt;dael> dbaron: Not sure how that works if you interleave with non-collapsed rules<br>
&lt;dael> TabAtkins: I'm thinking it just lives on a layer. Ther ineroperate with other rules in that layer<br>
&lt;dael> dbaron: So it breaks some author assumptions who put in 2 layers about wat overrides what?<br>
&lt;dael> TabAtkins: Shouldn't. Their layers respected in their own thing.<br>
&lt;dael> dbaron: That's what I was starting to think but convinced myself it made more sense<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: Definitely need more thought time on this topic.<br>
&lt;dbaron> s/more sense/no sense/<br>
&lt;dael> Rossen_: Going back to direction...2-layer approach vs continue to explore full set of options from jen and miriam. WHere are we swaying?<br>
&lt;dael> Rossen_: One thing I didn't grasp is would hte 2 layer prevent us from expanding later down the path to get full set of layers?<br>
&lt;dael> TabAtkins: I don't think it does. Particularly when we do it with a naming structure and we can distinguish between these defaults.<br>
&lt;dael> Rossen_: Same mental model as css properties then variables then custom properties? So we have properties now we're adding variables and we'll then expand<br>
&lt;dael> TabAtkins: yes<br>
&lt;Rossen_> ack fantasai<br>
&lt;dael> fantasai: I'm not convinced this requires naming. I would like to see us try and draft something more concrete.<br>
&lt;dael> fantasai: If we have multi prop that's interesting, but I haven't seen one that represents what we discussed in Jan and until we have one I don't think locking down is a good idea<br>
&lt;dael> TabAtkins: fantasai and I intend to put out a draft spec and will have miriam in that<br>
&lt;dael> fantasai: florian has also drafted ideas so we can talk together and see if we align or we come up with multiple proposals<br>
&lt;dbaron> I'm definitely interested in seeing more alternatives.<br>
&lt;dael> Rossen_: Last time we discussed we agreed to have a smaller taskforce. Is that forming?<br>
&lt;dael> many: yes<br>
&lt;dael> Rossen_: fantasai are you willing to take this on and get it organized?<br>
&lt;dael> chrishtr: miriam would you prefer to do it or have fantasai do it?<br>
&lt;dael> miriam: Fine if you take that<br>
&lt;dael> fantasai: miriam time zone?<br>
&lt;dael> miriam: Mountain<br>
&lt;dael> astearns: So I think we're done with this issue<br>

GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4969#issuecomment-664697335 using your GitHub account
Received on Monday, 27 July 2020 23:55:52 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:12 UTC