When I added Tailwind to my React project, it breaks existing styles.
I was hoping to just use Tailwind classes (like mb-3
) for shortcuts.
I didn't expect it to overwrite existing styles, like changing button background to transparent.
Am I doing it wrong? Or does Tailwind overwrite styles on purpose?
EDIT:
This is what I'm talking about: (which comes from node_modules\tailwindcss\src\css\preflight.css
)
The issue goes away when I exclude base, i.e:
//@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
EDIT 2:
Found the solution!
module.exports = {
corePlugins: {
preflight: false,
}
}