Last active
December 19, 2023 00:01
-
-
Save frzsombor/fd68071f1ccef39be00da8d59f3afd36 to your computer and use it in GitHub Desktop.
[SASS/SCSS] Aspect ratio padding class generator mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ratios: ( | |
4 3, | |
3 2, | |
16 9, | |
); | |
@each $x, $y in $ratios { | |
.aspect-ratio-padding-#{$x}-#{$y} { | |
padding-bottom: ($y / $x * 100%); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment