Re: [csswg-drafts] [css-sizing] Removing intrinsic aspect-ratio from an image (#6257)

I won't be able to attend the 7pm CSSWG call today — it's too late in the day for me to have the energy. But this seems cool. 

To better understand what's currently possible, I wrote this demo: https://codepen.io/jensimmons/pen/3c9e5163fb70b7fb25adad0db97494fa?editors=1100
Aspect ratios (natural or set as preferred) only works if one of the dimensions is `auto`, so an alternative solution in some usecases is to set both `width` and `height` to something besides `auto`, like `100%`.  

Even if other piles of code can reach the same result, `aspect-ratio: none;` is a easily understandable straightforward solution. And elegance is good.

I'd love to see what @mirisuzanne was coding up. 

I wouldn't want this to only work for images / `<img>`, but instead for any & all elements that have a natural aspect ratio — including `<video>`. 

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 June 2021 20:07:51 UTC