Container Query units - vertical unit all evaluate to zero
I think I've fallen into a pitfall with container query units.
100cqb
and 100cqh
are evaluating to zero, but 100cqi
and 100cqw
are working as expected.
Here's a simplified version I want I believe is all my relevant css:
Any ideas to the cause of why my max-height
is coming out as 0px
instead of >= 436px
?3 Replies
Because the
.parent
doesn't have a defined height.
min-height
isn't a set value, it's a minimum value... so it could be that, or it could be bigger. For cqh
to work, it needs a known value to work from, so it needs a height
.
For min-height
to work, it would need to first look at the child to figure out the height, which would then change the height of the child, which makes for circlular logic.
Using container-type: size
we're saying that the children play no role in the height
, so it goes to 0
.that makes sense. The
min-height
is actually being set by my framework but it really acts as height
as there is no way for it to get bigger that that value (it has it's own scroll context to handle overflow). Hopefully I can figure out an easy way to make the framework set an actual height
.good luck!