-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] umi max 与 tailwindcss 样式冲突 #9565
Comments
tailwindcss 和 antd 一起用,不是要加 tailwindcss 配置吗?主要是 “corePlugins”
|
感谢,按这个配置了 tailwind.config.js 文件,与 ant 冲突的问题解决了。 |
这个配置是 tailwind 的文档。 |
当我加了 plugin: [
plugin(({ addVariant }) => {
// addVariant('zh-CN', '&[lang="zh-CN"]');
// addVariant('en-US', '&[lang="en-US"]');
}),
// 本意为移除 base 中的部分样式
// 相关链接 https://stackoverflow.com/questions/71783177/remove-specific-style-from-tailwind-base
plugin(function ({ addBase, theme }) {
addBase({
h1: { fontSize: theme('fontSize.2xl'), background: 'red' },
h2: { fontSize: theme('fontSize.xl') },
h3: { fontSize: theme('fontSize.lg') },
});
addBase({ '#test': { background: 'red' } });
})
] 但是在生成的样式中没有 addBase 的样式 |
找到问题了,plugin -> plugins |
关闭 preflight 以后,可以通过引入 @tailwind base 使用的 modern-normalize.css 文件解决默认样式重置问题 |
What happens?
umi max 与 tailwindcss 样式冲突,比如下面的 button 按钮样式
Mini Showcase Repository(REQUIRED)
How To Reproduce
https://github.com/TanGuangZhi/ReactLearn
Context
The text was updated successfully, but these errors were encountered: