-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-grid] What happens with grid line names when dropping tracks #172
Comments
LGTM. |
I'm not sure what you mean by "will become". When there are zero tracks Firefox returns 'none' as the resolved value. I think this is the result you're suggesting, right? |
On Wed, Jun 8, 2016 at 12:29 PM, Mats Palmgren notifications@github.com wrote:
This is what's intended, yes. There isn't a good description of how to serialize resolved values, ~TJ |
So my intention was completely the opposite. I think that we should drop also the line names as we do for tracks. And I also mean that we shouldn't use them for positioning either. If you try to position items using the grid line names defined inside the repeat(auto-fit) then you have to deal with the risk that some tracks could get dropped. What's the point of keeping them around? |
Just to clarify things a new example: If you have no items, what would be the result using the options by @svillar on the first comment? BTW I also think that (b) is the best option in this case. |
That won't work. Dropping empty tracks happens after item placement. What you suggest implies doing line name resolution and item placement |
To my surprise, we actually do (b) in Rego's example. |
Yes sure, I didn't explain myself properly. I was talking about items dynamically inserted before dropping the tracks. As I said I think we should completely forget about tracks and lines. (Obviously adding an item might bring tracks&line-names back for the following items). In any case my conclusion is that there is not a "right" way to do this, so we better agree on something and do all the same. IMO the less confusing thing is to remove everything. WDYT? |
A third option would be to keep the tracks in the track listing, but force them to be zero-sized and suppress any gutters between adjacent collapsed tracks. This probably gives the most internally-consistent behavior (and would also be the most reasonable behavior for collapsed tracks if we ever handle visibility: collapsed in the future). Thoughts? |
Your gutter behavior isn't quite right; we need to either (a) have each collapsed track suppress one adjacent gutter (so "real collapsed real" still gets one gutter between the two real tracks, not 2, and "collapsed real collapsed" gets zero gutters), or (b) clarify that gutters only get generated between non-collapsed tracks (in other words, collapsing happens before gutter creation). I like (b) better, personally. |
…pped - collapsed tracks are forced to 0px, and collapsed gutters coincide. For issue #172.
Since collapsing the tracks instead of deleting them seems to give the most sane behavior, Tab and I think this would be the best thing to spec. We've drafted up some text for it, and would appreciate any thoughts on the result. We ended up collapsing gutters by specifying that they coincide, because the location of the gutters and the lines can be detected by abspos, so we can't just drop them. If at some point we add explicitly collapsing columns as a feature (e.g. via |
So, this change does NOT lead to any changes regarding line name resolution, |
Right. As far as we know, this should result only in observable changes to the position of absolutely-positioned elements pinned to the edges of collapsed tracks, and to the resolved track sizes of any collapsed tracks. It means that no lines or tracks are merged in the CSSOM as a result of auto-fit collapsing. |
Well, I believe this change DO NOT lead to any observable changes to the position of absolutely-positioned elements pinned to the edges of collapsed tracks (formerly dropped tracks). Given the following example, the left edge of the "abs" and "2" boxes should still |
Yes, that's the goal. Abspos placement should be referencing the same grid lines as in-flow grid placement. |
Good, then we're on the same page. |
And this was accepted in the telcon. |
@svillar , can you verify that this issue was resolved to your satisfaction? |
@fantasai : Absolutely. Already implemented in Chromium & WebKit BTW 😄 |
The specs mention that when using auto-fit, tracks with empty repetitions are dropped. My question is what happens with the grid line names defined in the repeat() function?
As far as I see it we have 2 options
a. we "collapse" them with other potential line names defined outside the repeat()
b. we remove them as we do with tracks
IMO (a) is not the right thing to do due to several reasons. First of all it seems weird to keep the line names and not the tracks. Secondly, we could lead to having only grid line names and no tracks in a definition (for example,
grid-template-rows: [a] repeat(auto-fit,[b] 10px [c]) [d];
assuming there are no items thengrid-template-rows
will become[a b c d]
without tracks which is invalid BTW). And last but not least I really don't see any use case for that.So my proposal is that the spec explicitly mentions (b).
WDYT?
The text was updated successfully, but these errors were encountered: