-
Notifications
You must be signed in to change notification settings - Fork 711
[css-align][css-multicol] 'justify-content' other than 'normal' or 'stretch' should change column count/size rules #1420
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
Comments
Er, the spec already says the thing about non- (Also, it uses "with" when it should be using "non- |
I don't see it either. Additionally, it feels like we need to say a bit more about how do the column-gaps interact with the distributed space. article {
columns: 3 100px;
column-gap: 10px;
width: 340px;
justify-content: space-evenly;
} which of the following two behaviors does it mean:
Behavior 2 is probably the one the spec currently intends (since it does not give enough details to define anything else), but would mean that the author needs to set the column-gap to 0 to get space-evenly and space-around to have their intended effect. In addition to being probably unexpected by authors, this does not have good fallback behavior in browsers that do no support justify-content on multi-col. Also, even in browsers that do support justify-content, if the width of the multicol is "just right", you may end up with no space between the columns at all, which seems pretty bad too. So I think Behavior 1 would be nicer, but it requires that we give a new meaning to column-gap in these situations. The logical answer would be that becomes a minimum spacing. For In that case, with the space-around and space-evenly values, unless we want to allow columns with a used width smaller than the specified width, we also need to change the formula to get the number of columns. For instance: article {
columns: 3 100px;
column-gap: 10px;
width: 320px;
justify-content: space-evenly;
} has 3 columns if you ignore This would mean changing the algo to determine the number of columns. Specifically, this part: |
This just seems like an error in applying https://lists.w3.org/Archives/Public/www-style/2016May/0208.html so taking it off the agenda and marking Needs Edits... |
This seems fair
I am not so sure about that. The minutes you quoted do not provide an answer to how the column-gaps interact with the distributed space, as I was discussing in my last comment. This is a discussion we still need to have. |
The obvious answer would be "in the same way as gaps between columns in Grid". |
Fixed now. We went with matching Grid's behavior - spacing is added in addition to the gutters, giving Florian's behavior #2. While I agree that this has slightly unfortunate implications with multicol's default column-gap, we think it's more important to have a consistent behavior than to give this a slightly different behavior that's slightly more optimal by default.
Grid has the same behavior, and is solved the same way - you can set up your minimum values with a combination of *-gap and padding on the container, in a ratio that matches the desired distribution, then the distribution spreads out the extra space accordingly.
This seems to require a distinction between two different stretching behaviors: one where all of the columns are stretched to fill the multi-col, and one where only the filled ones are stretched. We could make a distinction and say that |
…mns, and apply distribution in all cases of non-auto 'column-width'. Fixes #1420.
Hmmm. Grid gaps were designed to be the same as grid tracks, except empty, so I expect that behavior on Grid. Column gaps were not, so I do not have the same expectation.
Yeah, but the default value of column-gap is I don't think I'd necessarily object to the approach you're championing, but I do prefer the alternative, and wish we had a group discussion on this. There's also an other issue, kind of separate from this one but interacting with it: When the actual numbers of columns ends up being one, do we still want to apply whatever alignment model Needing to set the padding in proportion of the column gap to achieve You would not have that issue if gaps worked the way I said, and if we always fell back to Anyway, maybe you're right and I am wrong, but I think this would be good to hash out with a white board, and get input from author/author advocates like @jensimmons or @rachelandrew before closing on this. |
Right, thus the "slightly unfortunate implications" note. I agree it's slightly worse behavior, but when weighed against a strong inconsistency with how gaps work elsewhere, I think it's better for the future for column-gap to be consistent between Multicol and Grid. Special cases make people sad.
Correct (but in practice it's 1em, you can just use that).
We already have that behavior - if |
Except that if you had to add 1em of left and right padding to get |
Yes? That's exactly what's desired - you use padding/gaps to create the minimum spacing you want, and we assume that doesn't change just because you can only fit one column of content in. (Again, we're explicitly breaking the "acts exactly like Block when single-column" symmetry when you use a non-stretch justify-content.) |
Yes? That's exactly what's desired - you use padding/gaps to create the minimum spacing you want, and we assume that doesn't change just because you can only fit one column of content in. (Again, we're explicitly breaking the "acts exactly like Block when single-column" symmetry when you use a non-stretch justify-content.)
My intuition was that this does change because you can only fit one column of content in. I can see it make sense the way you suggest as well, but that wasn't what felt natural to me.
This seems sufficiently subjective that I'd be OK deferring to the WG if we have a majority agreeing with your intuition against mine, but it seems to me worth taking the time to consider the variants from an author / use case stand point, and get a WG resolution on this, rather than expedite it via an “Editor's Discretion” closure.
|
Happy to put it on the agenda, but I would object to Grid and Multicol behaving differently with respect to gaps vs. space-between/around/evenly, assuming the same value for the gaps. |
Taking the Agenda+ label off in favor of discussing this at the Paris meeting. |
Agenda+F2F again, since we did not discuss this last time. The right point to start reading this is #1420 (comment) (the part above is resolved). Restating my position: I believe the behavior proposed by tab&elika is acceptable, but I prefer the one I suggested, and it seems subjective, so I'd like the group's opinion before we're locked by web compat. |
As far as I can see, your objections are:
|
@tabatkins, correct. 1: this is now gone, since we have resolved on #2145 2+3: Your description is correct, that is what my preference is. It is a mild preference, so if you're opposing it with a strong objection, I guess I'll just fold (unless more people come out with stronger preferences / objections). But, or the sake of the argument, my logic is as follows. Multi-column typically contain in-flow body text. Without a gap, things would be unreadable, as lines of text across columns would seem connected. You need a way to say how much (at minimum) columns need to be apart when there's more than one of them. For this reason, you generally do not want to set the column-gap to 0. If there's only a single column, there's no need for separation at all, but column-gap doesn't create one, so all is good and you can just pretend there was no multicol at all and that you just got ordinary block layout. Once you do have separations and vertical white space, it is nice to be able to control how it's spread around, and that's where the alignment properties come in. You can use the padding trick to compensate for the column-gap, but then you lose the property of "when there's not much room, it's just block layout without any additional spacing or separation". This concern is not totally absent from grid or flexbox, but unlike multicolumn, grid of flexbox typically do not contain only in-flow body text (and do not contain a continuous flow of text fragmenting across the items), so the need to put some (variable amount of) whitespace around things doesn't necessarily go away when available space limits things to one item per row. Also, visual separation of the items may be achieved in other ways (backgrounds, borders, margins on the items, etc), so unlike multicol, setting the column (or row) gap to 0 is not necessarily a bad idea. That would work if column-gap was treated as a minimum for the distribution space that only kicks in if there's at least one actual column gap (i.e. at least two columns). Seems to me that this would more often just do the right thing without having to think about it. Also, you cannot (easily) roll your own with media queries, and you'd need element queries to do this right, but we don't have those. That said, while it seems to me that this would (almost?) always be the right thing to do for multi-col, maybe it would also sometimes be the right thing to do for flex-box and grid. Possibly we need to be able to switch between the two behaviors somehow, either with separate values or a separate property. But that does seem overkill. |
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: 'justify-content' other than 'normal' or 'stretch' should change column count/size rules<dael> github: https://github.com//issues/1420 <dael> astearns: We've discussed in the past. <dael> TabAtkins: As florian says from third to last comment, right place to start reading is the one above. <fantasai> https://github.com//issues/1420#issuecomment-378751428 <dael> TabAtkins: florian obj to current spec are 3. 1) in current spec you can't robustly fix the ratio of the defualt column gaps <dael> florian: fixed that <dael> TabAtkins: 2) default behavior of space between ends up with not the correct ratio because space-between space is added. Trivial fix, if you set column-gap to 0 it works. Solving it precisely would incolve special cases multii col if the column gap and so we'd be against that. <fantasai> sorry link to comment is https://github.com//issues/1420#issuecomment-303958104 <dael> florian: You should not set the column gap to 0, though, because depending on the space you end up with it might be 0 and it's unreadbale. <dael> TabAtkins: Then you set padding. <dael> florian: I'm not completely opposed to your proposal. Setting gap to 0 it can be mushed so you get padding on the edges. Typically multi col has text, though,a nd if you don't have roon you fallback to block which is good. BUt if you're forcing padding for space you keep the padding when you collapse. <dael> TabAtkins: I disagree. So you want space around. You leave column gap at 1em and padding to 1/2em on either side. I don't see why when you go to 1 colum that you don't want the 1/2em gap. You put it there for a reason and I don't see why it goes away. It goes away in multi col because it has no gaps, UBt you're explicitly putting the gaps. <dael> TabAtkins: If a single column you want the text flush you'd want that in many columns. <dael> fantasai: Like if you have 1 column and you split to 2 you don't want padding on common container but you want a gap between the 2. <dael> fantasai: I'm opposed to different map between multicol and flex. <fantasai> s/I'm/Regardless, I'm/ <fantasai> s/map/calc/ <dael> rachelandrew: Authors wouldn't use space around if they're not okay with gaps on the outside. If you didn't want that you'd use space between. <fantasai> s/flex/grid/ <fantasai> s/space between/space-between/ <dael> rachelandrew: I agree we want to be able to maintain the 1em so people don't set column-gap to 0. <dael> florian: This issue traces back to before we merged the models. Now we have. i'm okay with what you proposed, we jsut never discussed it. It was just added to the spec. If everyone agrees. <dael> fantasai: Prop: Alignment and gaps in multicol behave exactly like grid. <dael> astearns: Close no remaining changes. <dael> TabAtkins: I could go with a note for how it works. <dael> fantasai: I think people know how to do padding. They figured it would for grid so you'd have to have anot ein both. <dael> florian: There's many ways to space in grid that don't require figuring this out. I think a note wouldn't hurt. Doesn't have to be multicol specific, but I think it would help more there. <dael> astearns: I'd prefer the note because it shows we considered this, discussed, and have a solution. as people read they can agree or disagree. WIthout a note it's fairly opaque. <dael> astearns: Prop: alignment and gaps in multi col behave exactly like grid and we will add a not explaining the issues in the issue and how to solve them <dael> astearns: Obj? <dael> RESOLVED: alignment and gaps in multicol behave exactly like grid and we will add a note explaining the issues in the issue and how to solve them |
The sizing specification describes how
justify-content
applies to multicols. However, this application seems less than ideal given its interaction with the column count and sizing rules in multicol.In particular, when
justify-content
is notnormal
orstretch
, I think a non-auto
column-width
should apply as specified rather than being stretched so that the columns plus the column gaps fill the multicol. It seems pretty awkward not to do this.I also wonder whether
column-fill: auto
that doesn't fill all of the columns should cause some of the columns not to be generated, and leave only the filled columns (with their widths calculated as though they were all to be generated) to be justified. I have mixed feelings about this one, though.The text was updated successfully, but these errors were encountered: