This repository demonstrates a common error when using Tailwind CSS: forgetting to import the generated CSS file into your project.
Even if you're using Tailwind directives correctly in your components, if the CSS file isn't imported, no styles will be applied. This can be very frustrating to debug, as the error message is often non-existent.
The solution is straightforward: ensure that the generated Tailwind CSS file (typically output.css
) is correctly imported into your main application or component file.
bug.js
file uses Tailwind classes but doesn't import Tailwind's CSS.bug.js
)bugSolution.js
for the fix.