Tailwind V4 not compiling with dynamic values in class name #16159
-
|
We have various places in the codebase where we use template literals to build a dynamic classname, which substitutes dynamic values at runtime to form the final value for the arbitrary class name. Example: This was working fine in V3, but now these areas fail to compile: Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I don't think this ever "worked" in v3 on its own. You may have had a What's changed is that v4 is more unforgiving of this incorrect usage, see #15853 (comment). |
Beta Was this translation helpful? Give feedback.
I don't think this ever "worked" in v3 on its own. You may have had a
safelistor the same classes used elsewhere (see https://tailwindcss.com/docs/detecting-classes-in-source-files#dynamic-class-names or https://v3.tailwindcss.com/docs/content-configuration#dynamic-class-names).What's changed is that v4 is more unforgiving of this incorrect usage, see #15853 (comment).