Comments on: CSS Container Queries https://css-tricks.com/css-container-queries/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Fri, 19 Jul 2024 14:05:42 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Kevin C. https://css-tricks.com/css-container-queries/#comment-1849083 Fri, 19 Jul 2024 14:05:42 +0000 https://css-tricks.com/?p=378111#comment-1849083 A question about an issue I’m encountering. When I use a list of cards where each card is displayed using a container query and I’m using a tooltip (NuxtUI library), the text from the next card appears in front of that tooltip if it overlaps it. The tooltip appears correctly when I remove the “container query” part from the card. Is this because of the stacking order? Or is their a solution to this?

]]>
By: Katok https://css-tricks.com/css-container-queries/#comment-1825454 Wed, 12 Jun 2024 08:47:55 +0000 https://css-tricks.com/?p=378111#comment-1825454 But it’s still impossible to create a rule that would allow specific styles to be applied if the height of the container has certain values, right?

Just quick example:

Here is how we often use container queries for responsive layouts:

.card {
  container: card / inline-size;
}

.inner-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
}

@container card (width < 300px) {
  .inner-wrapper {
      grid-template-columns: 1fr;
  }
}

But let’s imagine that we need to do something, if our card will be too tall, for example, create fog fade:

@container card (height > 200px) {
  .inner-wrapper {
    max-height: 200px;
    overflow: auto;
    mask-image: linear-gradient(to top, transparent, #000 30%, #000)
  }
}

It won’t work, because we use inline-size as a type of container card. But if we’ll change the type to size, we must use certain height for the container (but we don’t actually know, what height it would be on the page, because content is different, and we just want to the safe our cards of oversize, and hide the content, and show some additional ui elements, etc.)

]]>
By: arkhi https://css-tricks.com/css-container-queries/#comment-1824823 Mon, 10 Jun 2024 21:55:15 +0000 https://css-tricks.com/?p=378111#comment-1824823 Hello. Thanks for the reminder about Container queries.

Aren’t all elements’ position static by default though?

]]>