From 3ea39841c8049525e31e9f4d6300f0c60cdb42de Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 24 Jan 2023 13:33:51 +0100 Subject: Adding upstream version 5.2.3+dfsg. Signed-off-by: Daniel Baumann --- scss/helpers/_ratio.scss | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scss/helpers/_ratio.scss (limited to 'scss/helpers/_ratio.scss') diff --git a/scss/helpers/_ratio.scss b/scss/helpers/_ratio.scss new file mode 100644 index 0000000..b6a7654 --- /dev/null +++ b/scss/helpers/_ratio.scss @@ -0,0 +1,26 @@ +// Credit: Nicolas Gallagher and SUIT CSS. + +.ratio { + position: relative; + width: 100%; + + &::before { + display: block; + padding-top: var(--#{$prefix}aspect-ratio); + content: ""; + } + + > * { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +} + +@each $key, $ratio in $aspect-ratios { + .ratio-#{$key} { + --#{$prefix}aspect-ratio: #{$ratio}; + } +} -- cgit v1.2.3