Re: [csswg-drafts] [css-gaps-1] Gap decorations next to empty grid areas (#12602)

The CSS Working Group just discussed `[css-gaps-1] Gap decorations next to empty grid areas`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> scribe+<br>
&lt;fantasai> kbabbitt: #1 feedback we got from authors so far is wanting more control over where gaps appear<br>
&lt;fantasai> kbabbitt: Layouts they wanted with unwanted decorations<br>
&lt;fantasai> kbabbitt: especially around empty areas<br>
&lt;fantasai> kbabbitt: Another example, they want the separators in second two rows, but no first<br>
&lt;fantasai> kbabbitt: Discussed different approaches<br>
&lt;fantasai> kbabbitt: one was to have a property similar to empty-cells<br>
&lt;fantasai> kbabbitt: another is concept of gap-decoration-areas, which was in original explainer but pushed out of Level 1<br>
&lt;fantasai> kbabbitt: in this case, you define an area based on grid syntax<br>
&lt;fantasai> kbabbitt: and override set of decorations for that area<br>
&lt;fantasai> kbabbitt: name the ara, refer to it in the gap decoration properties<br>
&lt;fantasai> kbabbitt: could define things for everything but the top, for example<br>
&lt;astearns> q+<br>
&lt;fantasai> kbabbitt: in both of these two cases, the authors did express preference for this over empty areas, but third example<br>
&lt;fantasai> kbabbitt: here is a responsive layout, where they have an outer grid and each headline article is a subgrid<br>
&lt;fantasai> kbabbitt: auto-fill grid, so as you size the window, columns reflow<br>
&lt;fantasai> kbabbitt: and you can't really identify the area<br>
&lt;fantasai> kbabbitt: so because of that, I'd like to solve with some sort of property to control decorations in empty areas<br>
&lt;fantasai> kbabbitt: some discussions about this, and I think the shape of it is a 5-state value to control where you want it<br>
&lt;fantasai> kbabbitt: current behavior is painting all the gaps<br>
&lt;fantasai> kbabbitt: might want to only paint if one side<br>
&lt;fantasai> kbabbitt: or only in left side or only one side or only both sides<br>
&lt;fantasai> kbabbitt: a few things to consider, one is what to name is<br>
&lt;fantasai> kbabbitt: another is do we want to do this<br>
&lt;fantasai> astearns: Would like to object to 1st solution where you define areas where rules apply<br>
&lt;fantasai> astearns: My concerns were, I like the fact that the syntax looks like grid-template-areas and has similar semantics<br>
&lt;fantasai> astearns: but I think it would get easily out of sync with template definition<br>
&lt;fantasai> astearns: and out of sync with what parts of the grid the content is actually flowing<br>
&lt;fantasai> astearns: You set up your rule areas expecting your content is in one place, but then change it, and forget to fix it up<br>
&lt;fantasai> astearns: so prefer dealing with empty areas directly<br>
&lt;astearns> ack astearns<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> fantasai: same concern as astearns for the areas version, seemed a bit fragile<br>
&lt;emilio> ... A property on the items themselves sounds like a good idea<br>
&lt;emilio> ... if the default is draw all the lines and you have a bunch of empty areas<br>
&lt;emilio> ... you can't turn those off easily<br>
&lt;emilio> ... I think you'd want a grid level thing<br>
&lt;emilio> ... and then a grid item thing that allows you to override it<br>
&lt;SebastianZ> +1 to fantasai<br>
&lt;emilio> ... so certain elements you want rules around<br>
&lt;emilio> ... instead of associating to a position on the grid<br>
&lt;emilio> ... you associate it on the item<br>
&lt;alisonmaher> q+<br>
&lt;emilio> ... so the item decides based on the content around it<br>
&lt;emilio> q+<br>
&lt;astearns> wondering whether someone will implement a CSS-only game of life with this new feature<br>
&lt;emilio> ... and whether you want that unilaterally or only if the other item enables it<br>
&lt;emilio> ... I think you still want a default behavior on the grid<br>
&lt;emilio> kbabbitt: for the first example, I guess you'd turn it off on the grid and then turn it on for some items<br>
&lt;emilio> fantasai: correct<br>
&lt;oriol> q+<br>
&lt;emilio> ... and sometimes you want to make it visible in all adjacent places, or only if there's an item around<br>
&lt;SebastianZ> q+<br>
&lt;emilio> ... and you want some items to be able to ignore and so on<br>
&lt;emilio> kbabbitt: so two props, one for the global state<br>
&lt;emilio> ... is that an on-off on the grid?<br>
&lt;emilio> fantasai: I think you need at most 3 states<br>
&lt;emilio> astearns: let's not worry too much about the details, let's go through the queue<br>
&lt;astearns> ack alisonmaher<br>
&lt;emilio> alisonmaher: what if there's multiple items with conflicting instructions?<br>
&lt;astearns> q+<br>
&lt;emilio> fantasai: I think we want items to turn things on and whether their presence turns things on, but not suppressing lines<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> fantasai: So an item could say "I want a line" or "I want a line if someone else wants a line"<br>
&lt;fantasai> fantasai: But can't turn it off<br>
&lt;JoshT> q+ turning on decs for specific cells<br>
&lt;astearns> ack turning<br>
&lt;Zakim> turning, you wanted to comment on decs for specific cells<br>
&lt;astearns> ack on<br>
&lt;astearns> ack the<br>
&lt;astearns> ack on<br>
&lt;emilio> emilio: was going to raise the same kind of concern<br>
&lt;astearns> ack the<br>
&lt;emilio> ... would like to not allow for weird conflicts<br>
&lt;astearns> q+ JoshT<br>
&lt;emilio> kbabbitt: I think that model makes sense to me<br>
&lt;astearns> ack oriol<br>
&lt;emilio> oriol: My question was about the 'whether there's content or not'<br>
&lt;emilio> ... do we care about absposes? Those are not technically a grid item<br>
&lt;astearns> ack SebastianZ<br>
&lt;emilio> fantasai: those don't count, if you are doing that you need to turn the lines unilaterally<br>
&lt;emilio> astearns: re. fantasai suggestion, there's no way to turn on things for empty areas<br>
&lt;emilio> ... because you can't target<br>
&lt;emilio> fantasai: seems unlikely you'd want something like that where you want specific empty areas<br>
&lt;emilio> s/astearns:/SebastianZ:/<br>
&lt;fantasai> s/empty areas/empty areas to have grid lines, but the rest of the grid to not/<br>
&lt;emilio> fantasai: if you want to turn them on on a particular area you can put an empty div there or a subgrid<br>
&lt;astearns> ack JoshT<br>
&lt;emilio> JoshT: Coming back to the question around being more precise about where the decorations go<br>
&lt;emilio> ... was talking to kevin about a potential use case we might have where you might have a grid, you don't want to show the lines above a cell that doesn't have an image on it?<br>
&lt;emilio> ... I wonder if we should still consider that kind of use case<br>
&lt;emilio> fantasai: can you review that example?<br>
&lt;emilio> JoshT: let me share my screen<br>
&lt;emilio> ... [shows bbc.cok.uk]<br>
&lt;emilio> ... we use border lines for dividers for things that don't have an image<br>
&lt;emilio> fantasai: is the layout that you have there such that you only have that row or they overlap?<br>
&lt;emilio> JoshT: they overlap and in this case it might be better to use border<br>
&lt;emilio> ... but there might be similar cases<br>
&lt;emilio> kbabbitt: is that something that you could do targetting elements that don't have an image?<br>
&lt;emilio> JoshT: I think so<br>
&lt;emilio> kbabbitt: then in this case you'd target non-image cards<br>
&lt;emilio> ... and turn the decorations on there<br>
&lt;SebastianZ> q+<br>
&lt;emilio> astearns: but if you can target them why would we need this extra proposal?<br>
&lt;emilio> astearns: I think what there's in the spec now allows to do this<br>
&lt;emilio> kbabbitt: no it's not, but with fantasai's proposal we would be able to do this<br>
&lt;emilio> astearns: I wanted to ask whether we were discussing this because this needs to be part of the first version of gap-decorations<br>
&lt;emilio> ... you're pulling it back in after pushing it off<br>
&lt;emilio> kbabbitt: What I pushed off was the grid areas version<br>
&lt;emilio> ... so this is more about solving some of these cases<br>
&lt;astearns> ack astearns<br>
&lt;emilio> ... the empty areas here I'd like to explore more<br>
&lt;emilio> ... because it's part of the feedback that we're receiving<br>
&lt;fantasai> rule-visibility-items: always | adjacent | between<br>
&lt;fantasai> rule-visibility-self: auto | always | between<br>
&lt;fantasai> s/adjacent/around/<br>
&lt;emilio> q?<br>
&lt;astearns> ack SebastianZ<br>
&lt;emilio> SebastianZ: maybe JoshT could share screen again?<br>
&lt;fantasai> rule-visibility-items: all | around | between<br>
&lt;fantasai> rule-visibility-self: auto | around | between<br>
&lt;emilio> ... I think the bbc use case is not completely covered by this thing<br>
&lt;emilio> ... you have an image aligned with the top line<br>
&lt;emilio> ... I guess you'd use border line<br>
&lt;fantasai> emilio: fact that it's aligned with top of border is an artifact of using border<br>
&lt;emilio> ... with gap decorations you wouldn't be able to achieve exactly that<br>
&lt;fantasai> s/.../sebastianz/<br>
&lt;emilio> fantasai: if you didn't have that alignment it'd be weird, that's why border would be the right tool here<br>
&lt;emilio> ... my proposal is above, `rule-visibility-items`<br>
&lt;emilio> ... `all` would be all borders<br>
&lt;emilio> ... `around` is for all the cells around each items<br>
&lt;emilio> q+<br>
&lt;emilio> ... `between` would be only if there's an adjacent item<br>
&lt;emilio> ... `rule-visibility-self` `auto` does whatever the grid container says<br>
&lt;emilio> ... the other values behave as expected<br>
&lt;emilio> kbabbitt: I like that, also like how they're named around the grid alignment properties<br>
&lt;oriol> q+<br>
&lt;emilio> fantasai: yeah and if we need extra control like per side you can split `rule-visibility-self` per side<br>
&lt;oSamDavis> q+<br>
&lt;emilio> SebastianZ: So you'd have `column/row-visibility-items` and `row-*`?<br>
&lt;emilio> fantasai: first q is whether we need that control<br>
&lt;emilio> ... but it'd be an easy extension<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: sounds good, but the items naming makes it sound like it will only put rules around the items, maybe use 'cells' or something<br>
&lt;fantasai> emilio: but otherwise seems like a reasonable start, and easy to extend<br>
&lt;fantasai> SebastianZ: but if you have a spanning item, you won't have it between those cells<br>
&lt;astearns> ack oriol<br>
&lt;fantasai> fantasai: I think consistency with the alignment properties is probably more important<br>
&lt;astearns> ack oSamDavis<br>
&lt;fantasai> oriol: What if there was one item and then a spanner that spanned over it, would there be a rule underneath the spanner?<br>
&lt;fantasai> fantasai: Not unless there would be one otherwise, I think.<br>
&lt;fantasai> oSamDavis: Would it affect layout?<br>
&lt;fantasai> kbabbitt: No, all it does is turn decorations on/off in certain places<br>
&lt;fantasai> astearns: Sounds like you have an outline of how to design this feature, so maybe take it and run with it and bring it back to us :)<br>
</details>


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


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

Received on Wednesday, 20 August 2025 13:40:58 UTC