w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.52k stars 673 forks source link

[css-cascade-5] Layers terminology bikeshed #5840

Closed bkardell closed 3 years ago

bkardell commented 3 years ago

Cascade 5 introduces a concept which it currently "cascade layers", in communications this frequently becomes just "layers". Myself (and I think a few others) suggested at one point that it would be ideal if it could not be "layer" which seems overloaded with stacking context layers and even concepts like "top layer". I'm not of the opinion that this would be disasterous, just that it is more ideal if we can avoid it by just using another term.

Other quick, not well thought out alternatives off the top of my head, "cascade priorities" or "cascade levels" or "cascade zones" ?

fantasai commented 3 years ago

Previous discussion on this issue: https://github.com/w3c/csswg-drafts/issues/4981

waterworx commented 3 years ago

“Levels” seems OK to me. “Sheet priority” ?

mirisuzanne commented 3 years ago

I think "levels" had generally positive comments in the previous thread. While "priority" makes a lot of sense, it might be confusing that these explicit layers/levels/priorities have a lower priority than normal (unlayered/leveled/prioritized) styles. So if you add @priority {} to an existing stylesheet, you would be de-prioritizing those styles.

argyleink commented 3 years ago

"levels" 👍🏻 "spaces"?

fantasai commented 3 years ago

My concern with levels is that it's less clear that the they wrap differently for non-important and important rules, and for the purpose of reverting rules in the !important half revert everything in the sandwich. Levels seems like it would be more of a flat, step-by-step ordering. At least, that's my impression.

LeaVerou commented 3 years ago

Brainstorming:

css-meeting-bot commented 3 years ago

The CSS Working Group just discussed [css-cascade-5] Layers terminology bikeshed.

The full IRC log of that discussion <dael> Topic: [css-cascade-5] Layers terminology bikeshed
<dael> github: https://github.com/w3c/csswg-drafts/issues/5840
<dael> miriam: This was raised by bkardell who is not on. I think others had similar concerns. I don't know if we need to wait for him
<dael> miriam: I can introduce it. One of the reasons we were drawn to layers is it's a nice methaphor like layering paint or following photoshop
<dael> miriam: Conflicts with existing like z-index and top-layer. Interest in finding something else.
<dael> miriam: Levels has come up repeatedly. A few others in thread
<dael> leaverou: Wasn't this called custom origins in the past? Reason to move from that?
<rachelandrew> q+
<dael> miriam: Different place then origins in the cascade. These are below shadow dom
<dael> florian: Other reason is origin is overloaded with single-origin policy. Not easy to confuse, but heavily used term
<astearns> ack rachelandrew
<dael> rachelandrew: I think there are a lot of people who have done this for a long time that have heard of term from netscape layers and then dreamweaver. I don't hear people talking to me about css layout with those terms. Might need explaining if we go with layers, though, because i can see old school people thinking it's layout
<astearns> ack fantasai
<smfr> q+
<dael> fantasai: We don't use layer in our specs except top-layer. Not that broadly used officially but origins is. Concern with levels is that it implies more of a one on top of the other in a straightforward order. Cascade layers have a sandwich effect where rules appear in two places and wrap around other layers. When you blow out a layer you can revert the blowing out if you put a !important
<dael> fantasai: It has more structure then I would guess from level. Having analyogy with photoshop layers is one of the reasons we chose
<dael> smfr: We use layers in multiple BG images in CSS BG spec
<dael> leaverou: Regardless of if we use it in specs it has a visual meaning anywhere else
<dael> florian: All words have meanings
<dael> leaverou: css and photoshop intersection is large
<dael> florian: Fair
<dael> florian: I'm unconvinced by levesl
<dael> leaverou: Agree levels is confusing
<TabAtkins> Put me on the anti-level bandwagon as well
<JonathanNeal> Figma refers to layers similarly as Photoshop, FWIW.
<fantasai> s/we chose/we chose it, they're similar as ideas of how to organize work/
<dael> leaverou: Added ideas in issue. What about defaults since they're low priority or group
<dael> astearns: Default sound css resets
<smfr> strata
<jensimmons> q+
<smfr> q-
<dael> fantasai: photoshop layers have imilarity in that it's a way to org work which you can arrange and there's transparency. I think it's a good analogy. they're called cascade layers, not just layers. I think layers is more evocative
<dael> TabAtkins: One possibility is to bake the full term into @rule so it's @cascadeLayer and not just @layer. Makes it very clear
<astearns> ack jensimmons
<dael> jensimmons: I was pretty determined on layers. Then had conversation recently and they had reasons to not like name. Bothered me for a while and I think it's b/c I agree with them. I can argue both that layers is confusing and it's not.
<bradk> “Layers” by itself evokes something like z-axis groups.
<dael> jensimmons: Layers is the idea of onion skin or layers is this thing for design. I think levels is a better word, though. You think about garages L1, L2, L3 without overlapping in other ways layer is used in rendering engine and in design
<argyle> @compose?
<dael> fantasai: But parking levels implies it's just there at that level. You don't see through the floor. If you park a garage on L1 it doesn't merge wil car on L4 to make a pattern. But that this what happens in layers in photoshop with transparency. Same with cascade. If you don't set at that layer it cascades in from below.
<dael> jensimmons: I don't like using whole phrase cascadelayer b/c hard for people to know how to spell cascade. Wonder how layer or level translates. I don't know, but it's something to think about
<dael> fantasai: Yeah, keyword layer but call it cacade layer where we talk about it
<bradk> @cascade-layer sounds better to me
<dael> astearns: Full name in tha @rule makes it easier to read. You can't mistake a cascade layer for anything else
<dael> florian: I don't think we have concensus. I'm happy with layers but not everyone is on that page. Back to GH to think?
<dael> astearns: Not hearing consensus to change, but also not for layer. I think we keep this open for a while.
<dael> jensimmons: Feels like a thing where it helps to write code and live with it and user test. It needs baking.
<dael> astearns: I think let's keep GH open and see where discussion goes
mirisuzanne commented 3 years ago

Potentially relevant? It looks like the Tailwind CSS library has added an @layer rule that has roughly the same purpose & block syntax, but with only three predefined layers. As far as I can tell, they added that in July – since we first resolved on the name.

ihorzenich commented 3 years ago

namespaces?

SebastianZ commented 3 years ago

@ihorzenich wrote:

namespaces?

@namespace is already taken, see https://www.w3.org/TR/css3-namespace/#declaration.

@fantasai wrote:

Levels seems like it would be more of a flat, step-by-step ordering.

Not necessarily. "Levels" are also a term in tree-like structures.

Sebastian

Malvoz commented 3 years ago

The draft Map Markup Language spec proposes a <layer> element (example usage) - and although it's not yet clear how styling MapML with CSS should work - I think authors are likely going to want to scope styles to these map layers, in which case the name @layer may (or may not) be thought to be appropriate, albeit different from cascade layers.

cc @prushforth FYI

mirisuzanne commented 3 years ago

Agenda+ to resolve this before browsers release the feature

css-meeting-bot commented 3 years ago

The CSS Working Group just discussed Layers terminology bikeshed, and agreed to the following:

The full IRC log of that discussion <dael> Topic: Layers terminology bikeshed
<dael> github: https://github.com/w3c/csswg-drafts/issues/5840
<dael> miriam: Another one open since the beginning. bikeshedding what we call layers.
<fantasai> +1 to layers
<dael> miriam: No alternative people liked better when we discussed. Seemed time to close or make a change
<dael> astearns: I think at this point there is a slight bit of reason not to make a change. In part b/c iml has started and articles written using layers term
<florian> keep it as is
<miriam> +1
<dael> astearns: I don't think it would keep us from changing, but would need good arguments for another term
<dael> astearns: Anyone want to argue layers is not the right word?
<dael> astearns: Prop: Keep "layers" and close issue no change
<dael> RESOLVED: Keep "layers" and close issue no change
<dael> astearns: Do ping Brian to make sure he's okay since he's not on the call and he opened the issue
mirisuzanne commented 3 years ago

@bkardell since you opened this, and you weren't on the call, I wanted to get your eyes on it before closing the issue.

bkardell commented 3 years ago

Yeah I don't have very strong feelings here really, it just felt there was perhaps a narrow window to consider avoiding any possible confusion. I think we're past that anyway, really and it is easily learned. If the group feels like 'layers' is the thing, I have no objection. Sorry I missed the call where it was discussed. Since I was the opener I'm happy to close it myself and retract the issue if that is easier.