Trying to use tailwind v4 alongside bootstrap #17072
-
I have a codebase that was built using react and bootstrap. I'm currently trying to migrate it to NextJS + taiilwind. I've looked around and seems the best way to do this is to set @layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities) prefix(tw); But for some reason, it's not working. I'm getting an intellisense error on @import "tailwindcss" It works. But if I do: @import "tailwindcss" prefix(tw); It doesn't work anymore even when I add the prefix. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The correct CSS would be: @layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme) prefix(tw);
@import 'tailwindcss/utilities.css' layer(utilities); To be clear, you'd also then need to add the prefix to all the Tailwind classes yourself in markup/templates: -<h1 class="text-3xl font-bold underline">
+<h1 class="tw:text-3xl tw:font-bold tw:underline"> |
Beta Was this translation helpful? Give feedback.
The correct CSS would be:
To be clear, you'd also then need to add the prefix to all the Tailwind classes yourself in markup/templates: