Skip to content

content.transform doesn't work in next.js #13706

Answered by wongjn
MrOxMasTer asked this question in Help
Discussion options

You must be logged in to vote

content.transform is used to change the file content that Tailwind sees before Tailwind scans for classes. The transformation result is then discarded after Tailwind has scanned the file. Next.js does not interact with this Tailwind configuration option.

This means that transforming does mean that the classes like hover:border-gray-300, hover:bg-gray-100, hover:dark:border-neutral-700, etc. get generated by Tailwind. However the rendered HTML still has the original classes like hover:(border-gray-300, bg-gray-100, dark:border-neutral-700, etc. that don't match the Tailwind generated classes. You'd need to look at matching the same transformation logic in Next.js if you want the class name…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MrOxMasTer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #13705 on May 18, 2024 21:45.