1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-28 23:59:53 +02:00

Switch from list to map for responsive embeds (#28678)

This commit is contained in:
Martijn Cuppens
2019-05-05 09:41:27 +02:00
committed by XhmikosR
parent be2ad67786
commit a776cc473d
3 changed files with 38 additions and 17 deletions

View File

@@ -27,13 +27,10 @@
}
}
@each $embed-responsive-aspect-ratio in $embed-responsive-aspect-ratios {
$embed-responsive-aspect-ratio-x: nth($embed-responsive-aspect-ratio, 1);
$embed-responsive-aspect-ratio-y: nth($embed-responsive-aspect-ratio, 2);
.embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} {
@each $key, $ratio in $embed-responsive-aspect-ratios {
.embed-responsive-#{$key} {
&::before {
padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x);
padding-top: percentage(map-get($ratio, y) / map-get($ratio, x));
}
}
}