Safelist support in V4 #16592
Replies: 4 comments 4 replies
-
|
@philipp-spiess sorry but is it possible to make that back as an issues ? As long as it's blocking for some of us, and we are multiples to wait this to go on v4, it should be cool to know the dev state of it. When I say multiples I think there is a lot, as long as, there are already a lot of messages in discussion, all agency I worked for, also wait this to switch their code base ect... |
Beta Was this translation helpful? Give feedback.
-
|
Hey! I'm sorry for your frustration here but wanted to give you some context on the two main issues with safelist in v4 and why we haven't brought it back yet:
In your case, my recommendation would be to try and limit the colors for your dynamic classes so that Tailwind CSS can properly detect all used classes and can strip out unused ones. Regarding the move to discussions: We reserve issues for bug reports with added reproductions, that's why I've moved this to a discussion instead. Devs will still read this I can assure you! |
Beta Was this translation helpful? Give feedback.
-
|
So, how are people detecting Tailwind classes from content in a database that has been created by content editors in a CMS? |
Beta Was this translation helpful? Give feedback.
-
|
There's now |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Request
Is it possible to make
safelistback in another way?In v3
safelisthelped to generate classes even if they are not used. However, it's no longer possible in V3, so dynamic classes like thisfrom-${themeColor}-gradient-startis no longueur possible.Existing placeholder solution why not use them ?
As mentioned by contributors, solutions exist if you really need to go to v4
safelist.txtHowever, no built-in solution exists, which I wait to upgrade.
Why ? Those solution works I tried them but:
safelist.txt-> not autonomous and a bit ugly solutionstyleoverrideclassnameTLDR
First I know that is already mentioned here and contributors work on it.
I created an issue to know the state of this feature as long as it's the only thing that prevent me from going to V4.
Suggestion
As mentioned in the Discussion [v4] Safelist?
@safelistis the best solution.Maybe something like this could do the job ?
Even if it generates too much (
text, bg, border, stroke, fill, from, to, hover, focus, group-hover ...), it's better than nothing.I think the common use of
safelistwas to ensure dynamic design, so a lot of configs looked like this.And edge case like
'group-hover/subtitlefor sure can be handled by adding a class manually.Beta Was this translation helpful? Give feedback.
All reactions