Change Generated Classes
Under normal circumstances, the Tailwind compiler generates CSS only for the class names that are used in your application. However, under some circumstances you might want to modify that configuration.
First, here’s what the compiler does.
The configuration file has a content key that should contain a list of file patterns for any file in your project that might reference a Tailwind utility. This includes your static .html files, but also your .jsx files for a React project or .erb files for a Rails project. It even includes other files that might reference Tailwind utilities that are called by template files. (But don’t include other .css files—you want to list the files that use Tailwind classes, not the files that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access