Re: [csswg-drafts] [css-grid][css-sizing] Aspect Ratio

This feature really is needed. It's a common use case to have to ensure a certain aspect ratio for each item, eg in Flexbox or Grid, through all viewport widths / element widths.

There are many results for just one hack
https://www.google.com/search?q=flexbox+aspect+ratio+padding-top+100%25
and eg https://css-tricks.com/aspect-ratio-boxes/

We need a real solution.

@ewanm89  wrote
> How about a simple ew relative unit added that is percentage of element width?
> 
> Then we can just height: 100ew; to make something square or height: 56.25ew for a 16:9 box?



I think I like it.

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

Received on Saturday, 31 March 2018 11:34:41 UTC