Skip to content
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-sizing-3] Does indefinite min-height: N% fall back to zero or auto? #2384

fantasai opened this issue Mar 4, 2018 · 3 comments


Copy link

fantasai commented Mar 4, 2018

In #2248 (comment) @MatsPalmgren wrote:

I was just updating some code dealing with min-width:auto and I'm wondering if min-width:N%with an indefinite percentage basis counts as auto in this context? In particular, does Automatic Minimum Size apply?

In #2248 (comment) @dholbert wrote:

I tend to think that it should apply, though I don't think any spec text says that it would. And really, CSS2 has text saying that for min-height (which in CSS2 was the only one of the min-{size} properties that could have an indefinite basis), it falls back to '0':

The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0'

I suspect "treated as '0'" there was really meant to signify "treated as the initial value". And so now, under that interpretation, this scenario should now fall back to auto-which-then-usually-gets-treated-as-0... This might want its own spec issue, though.

Thus, its own spec issue.

@fantasai fantasai changed the title [css-sizing-3] Does indefinite min-width: N% fall back to zero or auto? [css-sizing-3] Does indefinite min-height: N% fall back to zero or auto? Mar 4, 2018
Copy link

Agenda+ to figure out what people think makes the most sense: treating it as '0' or as 'auto'.

Copy link

The Working Group just discussed Does indefinite min-height: N% fall back to zero or auto?, and agreed to the following resolutions:

  • RESOLVED: treat indefinite percentages in min-width and min-height as 0
The full IRC log of that discussion <dael> Topic: Does indefinite min-height: N% fall back to zero or auto?
<dael> github:
<dael> TabAtkins: This is for min-width and height. Do they fallback to auto or 0? General rule is we fall back to initial value. Is that 0 or auto? Initial used to be 0, changed to auto.
<dael> TabAtkins: 2.1 explicitly says they're treated as 0, but it was prob on the assumption 0 was the initial value.
<dael> TabAtkins: Only real case is you have a flex item and you can't resolve the min-height should it be auto or 0?
<dael> TabAtkins: I'm of the opinion it hsould be auto.
<dael> Rossen: Current?
<dael> TabAtkins: 0 which was previous initial value.
<dael> TabAtkins: Change to be consistent with the change to initial.
<dael> fantasai: I'm trying to wrap my head around when this would be different.
<dael> astearns: Last time we discussed 0% when we said it should be 0 it's different on width then min-width.
<dael> fantasai: auto for width isn't hte same as min-width.
<dael> astearns: We could throw out the calc on min-width if it's doesn't resolve.
<dael> TabAtkins: either the percent 0s out or we throw it out.
<dael> fantasai: Makes more sense.
<dael> tantek: Treat min-width and min-height the same as we just resolved to deal with percentages.
<dael> astearns: So it's 0 rather then auto.
<dael> TabAtkins: Still a change from current. calc is replaced with 0. Current is calc(10%+10px) = 0. Now it's =10px.
<dael> fantasai: This makes the most sense. Consistent with margins and padding.
<dael> fantasai: If you set min-width to a non-auto size you're not expecting it to look at content
<dael> astearns: Prop: treat indefinete % in min-width and min-height as 0
<dael> RESOLVED: treat indefinite percentages in min-width and min-height as 0
<dael> Rossen: This is web compat?
<dael> TabAtkins: If you have a complex calc it's a change. percent only is the same.

Copy link
Collaborator Author

Resolved: Zero out the percentage, as we do for margins/padding

fantasai added a commit that referenced this issue Apr 21, 2018
fergald pushed a commit to fergald/csswg-drafts that referenced this issue May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants