Skip to content

tailwindcss not applied when using {@html myObject.html} #3776

Answered by jonolo6
ITwrx asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand your explanation correctly you have Tailwind classes included in the html that is returned from the DB and expect that to be styled correctly. If so then probably what is happening is that those utility classes are purged out during build. The purge process for Tailwind is there to ensure the bundled css is kept as small as possible and works by simply scanning through the source code to find the utility class names to bundle. If not found - they are purged/removed from the bundled css. I don't think you should use tailwind classes in HTML outside of the source code (say in a DB). It is probably best to use pure css in those situations.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ITwrx
Comment options

Answer selected by ITwrx
Comment options

You must be logged in to vote
1 reply
@aloker
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants