Upgrading v3 custom classes to v4 not working when using screen breakpoints #17111
-
We're in the process of moving from v3 to v4, and we've hit a stumbling block that our custom typography classes are not working when used with a screen breakpoint. We're using NextJS 15 and tailwind 4.0.12. An example of the implementation: <h1 className="mobile-heading-big-bold xl:desktop-heading-small-bold xl:pb-10">...</h1> In devtools, In v3, we had: @layer base {
.mobile-heading-big-bold {
font-size: 2.75rem;
font-weight: 700;
line-height: 2.75rem;
letter-spacing: -0.02em;
}
} This worked fine, but now if v4, as soon as Is there a way of getting custom classes to generate with media queries? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yep! Use @utility desktop-heading-small-bold {
…
} https://play.tailwindcss.com/Y7c46z7J0y?size=1290x720&file=css |
Beta Was this translation helpful? Give feedback.
Yep! Use
@utility
:@utility desktop-heading-small-bold { … }
https://play.tailwindcss.com/Y7c46z7J0y?size=1290x720&file=css