Skip to content

Tailwind v4.1 – How to prevent purge of dynamic classes like from-${type} / to-${type}? #17999

Answered by RobinMalfait
KoMiToRaY asked this question in Help
Discussion options

You must be logged in to vote

Hey!

There is no such thing as a purge step. Tailwind works by generating classes it can see.

You can read more about this here: https://tailwindcss.com/docs/detecting-classes-in-source-files#dynamic-class-names

One thing you can do is use CSS variables and use those in the from-(--my-from-value) and to-(--my-to-value)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@KoMiToRaY
Comment options

Answer selected by KoMiToRaY
Comment options

You must be logged in to vote
1 reply
@wongjn
Comment options

wongjn Aug 13, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants