I am working on migrating a code base from Styled Components to Tailwind v4.
To avoid introducing breaking changes to our design, I want to continue using the same media breakpoints and media queries, which are different from the default values in Tailwind
From the docs on adding custom variants, I can see that I can use the @custom-variant directive.
But, can I use that for defining custom media breakpoints?
e.g. like this:
@custom-variant max-xs (@media (max-width: 375px));
@custom-variant max-sm (@media (max-width: 576px));
@custom-variant max-md (@media (max-width: 768px));
Is this valid Tailwind syntax?
If not, how can I create custom media queries in Tailwind v4?
<=to<when usemax-{breakpoint}. See generated CSS: play.tailwindcss.com/MryeIVxhHc?file=css