hypothetical/resources/sass/mixins/_aspect-ratio.scss

8 lines
185 B
SCSS

@mixin aspect-ratio($width, $height) {
&:before {
content: "";
display: block;
width: 100%;
padding-top: (math.div($height, $width) * 100%);
}
}