Fix ratio utility
This commit is contained in:
@@ -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%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user