I am having an issue with my Next.js app. I upgraded to Tailwind 4 and as I understand the docs, there should be build in support for container queries. But the following code doesn't seem to work:
<div className="grid grid-cols-7 text-center font-h3 mb-1" role="row">
{new Array(7).fill(0).map((_, i) => (
<div key={i} role="columnheader" className="@container">
<span className={clsx("hidden @md:inline", small ? "lowercase text-primary-500": "@md:normal-case @md:text-black")}>
{small ? shortWeekLabels[i] : longWeekLabels[i]}
</span>
<span className="@md:hidden lowercase text-primary-500">
{shortWeekLabels[i]}
</span>
</div>
))}
</div>
If I replace the @md prefixes with their regular breakpoint counterparts, they work. But as my component is used in a dynamic layout, that makes changes less 'linear' I would prefer using container queries. What am I doing wrong?