mirror of
https://github.com/twbs/bootstrap.git
synced 2024-09-21 18:47:15 +00:00
18f8601d29
- 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
32 lines
476 B
SCSS
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};
|
|
}
|
|
}
|