Koala
TTCTheo's Typesafe Cult
•Created by Koala on 5/20/2024 in #questions
Sizing to fit parent container, while respecting css "aspect-ratio"
ok, solution (for minimal example) was
aspect-square h-[min(100vh,100vw)]
for my original problem (not shown here) i had to do:
aspect-square h-[min(50vw-24px,100vh-210px)]
(50vw since there are 2 side by side, and the arbitrary px values guessed/checked until it matched parent)
if trying to do any aspect ratio other than a square, obviously need to adjust away from 100 and use your 1:decimal ratio6 replies
TTCTheo's Typesafe Cult
•Created by Koala on 5/20/2024 in #questions
Sizing to fit parent container, while respecting css "aspect-ratio"
Here's a minimal example stackblitz:
https://stackblitz.com/edit/stackblitz-starters-zhkpve?file=index.html
6 replies
TTCTheo's Typesafe Cult
•Created by Koala on 5/20/2024 in #questions
Sizing to fit parent container, while respecting css "aspect-ratio"
(and on parent container resize):
6 replies
TTCTheo's Typesafe Cult
•Created by Koala on 5/20/2024 in #questions
Sizing to fit parent container, while respecting css "aspect-ratio"
need it to look like:
6 replies