Reblogged by slightlyoff@toot.cafe ("Alex Russell"):
belldotbz ("Andy Bell") wrote:
I don't know who needs to hear this (me) but you don't have to mess around calculating an aspect-ratio in CSS.
Say you've got a Figma comp and the element is 500px wide and 280px high, the CSS is:
.my-element {
aspect-ratio: 500/280;
}Scales beautifully.