Skip to content

tailwind css inside index.css doesn't appear in a lazy loaded component in react #13611

Answered by wongjn
Wulgaren asked this question in Help
Discussion options

You must be logged in to vote

The problem is the way you have your CSS structured. The per-component CSS you have each with their own Tailwind directives means that the Tailwind-compiled CSS gets generated per each CSS file you have:

Untitled.video.mp4

This then causes rules to override each other and will cause your undesired behavior:

First, I'd try to see if you can stick to Tailwind classes in the markup instead of any custom CSS.

For any CSS that doesn't necessarily need Tailwind features, consider removing any Tailwind CSS-language syntax from them. This would allow you to still have separate CSS files without needing to have the @tailwind directives in all of them. This would then mean less conflictio…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Wulgaren
Comment options

@wongjn
Comment options

Answer selected by Wulgaren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants