Safelist in V4 #15291
-
It seems that V4 is not recognizing the colors implemented in the backend (if you are not using the full class name like text-{{ $color }}) . In version 3, I used to safelist them as shown below. How should I handle this in V4? tailwind.config.js in v3: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You could consider using the <div style="color: var(--color-{{ $color }})"> |
Beta Was this translation helpful? Give feedback.
-
I believe regex patterns and/or variants don't work in v4. In v4 I have to list all 12 statically, e.g. The following pattern works in v3 but not in v4:
|
Beta Was this translation helpful? Give feedback.
-
Is there any news on how safelist will work in v4? (not using tailwind.config.js) |
Beta Was this translation helpful? Give feedback.
You could consider using the
style
attribute like: