Help! How can I fix the override issue between Tailwind v4 and Ant Design v5? #15822
Unanswered
skt-developer-007
asked this question in
Help
Replies: 2 comments 6 replies
-
Could you provide a minimal reproducible example please? As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding |
Beta Was this translation helpful? Give feedback.
3 replies
-
Hi, You may try this configuration.
//App.tsx
import { StyleProvider } from '@ant-design/cssinjs';
<StyleProvider layer>
<App {...props} />
</StyleProvider>
/*globals.css*/
@layer antd, theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I upgraded Tailwind from v3 to v4, and this issue came up.
I removed the padding styles from Ant Design to control them myself and added !important to py-[4rem] to make it override Ant Design’s styles. However, I now want to set a separate style for the Ant Design Input component with py-[1rem], but it’s not working as expected.
How can I fix this issue?
globals.css
page.jsx
Beta Was this translation helpful? Give feedback.
All reactions