This repository contains a bug report and solution for a common issue with Tailwind CSS where classes are not applied correctly despite proper configuration and imports. The bug is demonstrated in bug.js
and the solution is provided in bugSolution.js
.
The bug occurs when using Tailwind CSS classes in an HTML file. The classes are not rendered, resulting in unexpected styling. The problem is related to the way Tailwind CSS processes the HTML file.
The solution involves ensuring the content
option in tailwind.config.js
includes the correct paths to HTML files. The provided solution ensures all the necessary paths to scan are included to ensure the correct identification and application of Tailwind CSS classes. This fixes the issue and allows the classes to be applied and rendered appropriately. This solution also updates index.html
to use the locally installed Tailwind CSS, removing the CDN reference. This is a best practice and ensures proper version management.