-
i have my index.css file loading in main.tsx, inside index.css i have the basic
and then i have a few styles for the general html elements
etc. but when i set lazy loading inside my app.tsx as such:
suddenly those css aren't applied (for example button doesnt have the padding. what can i do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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.mp4This 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 If you would still want custom CSS, consider having it in the If you would still want separate custom CSS files, consider |
Beta Was this translation helpful? Give feedback.
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…