Trying to use tailwind v4 alongside bootstrap #17072
Unanswered
Keith-Web3
asked this question in
Help
Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
preflight
to false and add atw
prefix to prevent conflicting classNames with bootstrap.From the v4 docs, I figured this would be the right way to do it:
But for some reason, it's not working. I'm getting an intellisense error on
prefix(tw)
and the styles are not being applied. If I replaced the code with just:It works. But if I do:
It doesn't work anymore even when I add the prefix.
I would really appreciate if I can be pointed in the right direction in case I'm doing something wrong.
Beta Was this translation helpful? Give feedback.
All reactions