Re: [csswg-drafts] [css-sizing] Rethinking how to prevent overflow in a container with an explicit aspect ratio

> It seems this will work if min-height beats height.

`min-height` does beat `height`, so this works, and I agree it means we don't need "option a", as we can indeed just do that. (As for option "b", if doing this is the only use case for it, we don't need it either, but it can express different things as well. Whether we need those is a different conversation).

However, for elements other than replaced elements / scrollers / iframes, I think this behavior should be the default one, rather than something authors need to opt into, in order to avoid accidental overflow when the font happens to be bigger than expected, or any other situation where the layout ends up being not exactly what the author had in mind.

Given that the initial value of `min-height` is `auto`, maybe we're in luck. How about defining that when `aspect-ratio` is set and the element is non-replaced / a scroller / an iframe, then `min-content: auto` resolves to `max-content` (or , as you said perhaps `min-content`)?

It looks like this would solve both the problem of having this behavior by default, and of making it possible to override, simply by having authors manually set `min-height` to `0` when they don't want things to auto-grow.


-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3268#issuecomment-437731901 using your GitHub account

Received on Monday, 12 November 2018 02:19:23 UTC