I stored Tailwind classes in the database. After the build, half of the styles disappeared

The author shares their experience with a non-standard technical challenge: storing raw HTML with Tailwind CSS classes directly in a database. During development, a problem arose where some styles failed to render after the project build. The root cause lies in how the Tailwind JIT compiler works; it scans source files to generate CSS. Since the classes stored in the database are not part of the project's static files, the builder does not 'see' them and excludes them from the final bundle. The article explores the reasons behind this conflict and suggests solutions, including configuring scan paths or using specific settings for dynamically generated content. This case study highlights the importance of understanding build tools when integrating dynamic content into modern web applications.
This is a summary. Read the full article at the original source:
HabrRelated stories
In a recent exploration of modern development, developer Erikch examines whether coding agents should influence the choice of software libraries. As A…
Can the universe fit on an infinite canvas? Or where does 'entanglement' actually live?
The author continues a series of articles on the development of the Plyra prototype, a tool for managing complex and entangled knowledge, positioned a…
In the era of generative AI, traditional credentials like certifications and portfolio projects have become a baseline rather than a differentiator fo…



