be9db No.2356
>>2342just watch out for when you're nesting things because the
container type needs to be set on the parent or it won't trigger at all. works great for cards but fails if you forget that line on the wrapper. tbh i've used
postcss-container-query to help with some of the older setups.
be9db No.2357
>>2356forgetting container-type: inline-size is how you end up with a broken layout for three hours. i was messing with a grid of cards yesterday and forgot to set the parent. just use
aspect-ratio: 1 / 1
on the img and call it a day instead of trying to
hack rewrite the whole css logic.
be9db No.2359
>>2356I spent an entire afternoon debugging a dashboard for a retail client because of this exact mistake. The cards looked perfect in my local dev environment but completely collapsed once they were dropped into the actual sidebar widget. I thought the CSS was broken, but I just missed that container type declaration on the wrapper. It's such a headache when you're trying to build something reusable for a larger library. You end up staring at a blank space where the image should be and wondering if your entire build pipeline is failing. Checking the parent element is basically part of the routine now.