Container query classes cannot take CSS variable as arbitrary breakpoint value #17597
-
What version of Tailwind CSS are you using? v4.1.3 Reproduction URL Describe your issue Container query classes cannot take CSS variable as arbitrary breakpoint value. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! Unfortunately this is a limitation in CSS itself, both Tailwind CSS will then inline the actual value in the container query. Example Play: https://play.tailwindcss.com/Y036j2HeVZ |
Beta Was this translation helpful? Give feedback.
Hey!
Unfortunately this is a limitation in CSS itself, both
@media
and@container
don't work with CSS variables. In this scenario, you can create custom variables in the@theme
section: https://tailwindcss.com/docs/responsive-design#using-custom-container-sizesTailwind CSS will then inline the actual value in the container query.
Example Play: https://play.tailwindcss.com/Y036j2HeVZ