diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2018-11-11 12:04:04 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-11-11 12:04:04 +0300 |
commit | 976efcd5ee95a37b14c64620ff39675b11b94e73 (patch) | |
tree | 684941d1bdf6a602bc400949ae0d2d888fb1e9f7 /scss/utilities | |
parent | 9836a411e81a117b47c8deacff17b04fc30d6b5d (diff) |
Allow to add more embed responsive ratios (#25894)
Diffstat (limited to 'scss/utilities')
-rw-r--r-- | scss/utilities/_embed.scss | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/scss/utilities/_embed.scss b/scss/utilities/_embed.scss index d3362b6fdb..4497ac0400 100644 --- a/scss/utilities/_embed.scss +++ b/scss/utilities/_embed.scss @@ -27,26 +27,13 @@ } } -.embed-responsive-21by9 { - &::before { - padding-top: percentage(9 / 21); - } -} - -.embed-responsive-16by9 { - &::before { - padding-top: percentage(9 / 16); - } -} - -.embed-responsive-4by3 { - &::before { - padding-top: percentage(3 / 4); - } -} +@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-1by1 { - &::before { - padding-top: percentage(1 / 1); + .embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} { + &::before { + padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x); + } } } |