Fix ratio utility

This commit is contained in:
Antoine Boulanger
2019-04-19 11:47:29 -04:00
parent 6d8954563a
commit 52db1cc63e

View File

@@ -23,20 +23,18 @@ $aspect-ratios: (
// <div class="o-ratio -16:9"> // <div class="o-ratio -16:9">
// //
// //
.o-ratio { @each $ratio in $aspect-ratios {
@each $ratio in $aspect-ratios { @each $antecedent, $consequent in $ratio {
@each $antecedent, $consequent in $ratio { @if (type-of($antecedent) != number) {
@if (type-of($antecedent) != number) { @error "`#{$antecedent}` needs to be a number."
@error "`#{$antecedent}` needs to be a number." }
}
@if (type-of($consequent) != number) { @if (type-of($consequent) != number) {
@error "`#{$consequent}` needs to be a number." @error "`#{$consequent}` needs to be a number."
} }
&.-#{$antecedent}\:#{$consequent}::before { &.u-#{$antecedent}\:#{$consequent}::before {
padding-bottom: ($consequent/$antecedent) * 100%; padding-bottom: ($consequent/$antecedent) * 100%;
}
} }
} }
} }