0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-23 20:54:22 +01:00
Bootstrap/scss/helpers/_ratio.scss

29 lines
451 B
SCSS
Raw Normal View History

2024-07-29 22:04:11 -07:00
@use "../variables";
// Credit: Nicolas Gallagher and SUIT CSS.
.ratio {
position: relative;
width: 100%;
&::before {
display: block;
2024-07-29 22:04:11 -07:00
padding-top: var(--#{variables.$prefix}aspect-ratio);
content: "";
}
> * {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
2024-07-29 22:04:11 -07:00
@each $key, $ratio in variables.$aspect-ratios {
.ratio-#{$key} {
2024-07-29 22:04:11 -07:00
--#{variables.$prefix}aspect-ratio: #{$ratio};
}
}