bootstrap/scss/helpers/_embed.scss
Mark Otto 18f8601d29 Updates responsive embeds with new class names and CSS variables
- Renames .embed-responsive-XbyY classes to .embed-responsive-XxY
- Simplifies the Sass map to just be key and value, ratio and percentage
- Builds .embed-responsive-* modifiers with CSS variables
- Updates docs to show power of CSS variables
- Add notes to the Migration guide
2020-09-23 13:30:11 -07:00

32 lines
476 B
SCSS

// Credit: Nicolas Gallagher and SUIT CSS.
.embed-responsive {
position: relative;
width: 100%;
&::before {
display: block;
padding-top: var(--aspect-ratio);
content: "";
}
.embed-responsive-item,
iframe,
embed,
object,
video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
@each $key, $ratio in $embed-responsive-aspect-ratios {
.embed-responsive-#{$key} {
--aspect-ratio: #{$ratio};
}
}