csstools / postcss-preset-env

Convert modern CSS into something browsers understand
https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env
Creative Commons Zero v1.0 Universal
2.22k stars 90 forks source link

Add `aspect-ratio` support #187

Closed brielov closed 2 years ago

brielov commented 4 years ago

There is a work in progress draft to finally bring aspect-ratio boxes to CSS, it would be nice to have it baked into this awesome tool.

MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio

madeleineostoja commented 2 years ago

Now that this is supported in all evergreens I'd say this is an essential. I didn't realise this wasn't polyfilled until I tested on an older version of iOS where aspect-ratio wasn't supported.

romainmenke commented 2 years ago

This can't be polyfill in postcss-preset-env as we would have to make too many assumptions about how the HTML is structured.

I wrote a polyfill for aspect-ratio that is used internally at work and most frontend devs have trouble using it because the html (and other CSS) has be just right.

I will consider open sourcing that plugin separate from postcss-preset-env. That gives people the option of using it without causing too much support requests for maintainers of postcss-preset-env