Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[css-align][css-multicol] 'justify-content' other than 'normal' or 'stretch' should change column count/size rules #1420
Comments
dbaron
added css-align-3 css-multicol-2
labels
May 20, 2017
|
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: |
frivoal
added the
Agenda+
label
Jun 6, 2017
frivoal
self-assigned this
Jun 6, 2017
fantasai
added Needs Edits and removed Agenda+
labels
Jun 13, 2017
|
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". |
tabatkins
referenced
this issue
Jun 26, 2017
Open
[css-multicol] Add switch to avoid generating empty column boxes? #1565
|
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 |
tabatkins
closed this
Jun 26, 2017
fantasai
added Closed Accepted as Obvious Bugfix and removed Needs Edits
labels
Jun 26, 2017
fantasai
added a commit
that referenced
this issue
Jun 26, 2017
|
|
fantasai |
4aa7b02
|
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. |
frivoal
reopened this
Jun 27, 2017
frivoal
added the
Agenda+ F2F
label
Jun 27, 2017
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. |
fantasai
added the
Agenda+
label
Jul 5, 2017
|
Taking the Agenda+ label off in favor of discussing this at the Paris meeting. |
dbaron commentedMay 20, 2017
The sizing specification describes how
justify-contentapplies 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-contentis notnormalorstretch, I think a non-autocolumn-widthshould 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: autothat 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.