0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-26 23:54:23 +01:00
Bootstrap/scss/helpers/_ratio.scss
2024-07-30 11:16:28 +02:00

29 lines
457 B
SCSS

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