Skip to content
Snippets Groups Projects
Commit 4338235b authored by Kevin Lin's avatar Kevin Lin
Browse files

_sass: Add --aspect-ratio and --add-height custom properties

parent 5fd9fb01
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,34 @@ summary {
font-size: 1.1em;
}
}
[style*="--aspect-ratio"] > :first-child {
width: 100%;
}
[style*="--aspect-ratio"] > img {
height: auto;
}
@supports (--custom:property) {
[style*="--aspect-ratio"] {
position: relative;
}
[style*="--aspect-ratio"]::before {
content: "";
display: block;
padding-bottom: calc(100% / (var(--aspect-ratio)));
}
[style*="--add-height"]::before {
padding-bottom: calc(100% / (var(--aspect-ratio)) + (var(--add-height)));
}
[style*="--aspect-ratio"] > :first-child {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment