Replies: 9 comments 13 replies
-
Not solved yet but something we're going to look into soon. I secretly wish no one used this feature though 😄 |
Beta Was this translation helpful? Give feedback.
-
Hi, just wondering if there is an update on this. I am using a variable name in my class name (something like |
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.
-
I guess it's always possible to include all supported classes somewhere, be it a component's allowed props or maybe even a text file you import somewhere, right? |
Beta Was this translation helpful? Give feedback.
-
I faced one use case for cms html content that uses Tailwind for styling. I think Tailwind v4 should natively support a safelist again. |
Beta Was this translation helpful? Give feedback.
-
As long as it's the only thing that prevent me from going to v4 I created an issue to know the development point of it. |
Beta Was this translation helpful? Give feedback.
-
here a good answere made and explain the global issue with safelist and how to implement similar things if anyone wondering #16592 (comment) |
Beta Was this translation helpful? Give feedback.
-
When migrating the project to Next.js v15 and Tailwind v4, I encountered an issue where I could no longer use Why i used
|
Beta Was this translation helpful? Give feedback.
-
Another good solution for cases where the "color" (hex, OKLCH, rgba or whatever) comes from a CMS is to use <div style="--foo-bg: ${COLOR_FROM_CMS};" class="bg-(--foo-bg)">...</div> This way, you end up with a single selector in the compiled Tailwind CSS, but it still covers any color coming from the CMS. |
Beta Was this translation helpful? Give feedback.
-
With no tailwind.config.js in v4 anymore - how can we implement the
safelist: []
option in v4? Is there a @safelist directive?Beta Was this translation helpful? Give feedback.
All reactions