mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-19 11:51:23 +02:00
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
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// Credit: Nicolas Gallagher and SUIT CSS.
|
||||
|
||||
.embed-responsive {
|
||||
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
&::before {
|
||||
display: block;
|
||||
padding-top: var(--aspect-ratio);
|
||||
content: "";
|
||||
}
|
||||
|
||||
@@ -24,8 +26,6 @@
|
||||
|
||||
@each $key, $ratio in $embed-responsive-aspect-ratios {
|
||||
.embed-responsive-#{$key} {
|
||||
&::before {
|
||||
padding-top: percentage(map-get($ratio, y) / map-get($ratio, x));
|
||||
}
|
||||
--aspect-ratio: #{$ratio};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user