We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
通过cdn的方式引入antd和@ant-design/pro-form,引入成功后,发现原本定制的主题色,被覆盖成了默认的主题色。 翻了一下@ant-design/pro-form的源码,发现是它在<head>里插入了很多<style>,包含默认的样式,导致定制的主题色被覆盖。
antd
@ant-design/pro-form
<head>
<style>
{ //...other config antd: { disableBabelPluginImport: true }, externals: { react: 'React', 'react-dom': 'ReactDOM', '@ant-design/pro-form': 'ProForm', '@ant-design/pro-descriptions': 'ProDescriptions', '@ant-design/pro-table': 'ProTable', antd: 'antd', }, styles: [ 'https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/table.min.css', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/form.min.css', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/descriptions.min.css', ], scripts: [ 'https://unpkg.com/[email protected]/umd/react.production.min.js', 'https://unpkg.com/[email protected]/umd/react-dom.production.min.js', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.js', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/form.js', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/table.min.js', 'https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/dist/descriptions.min.js', ], }
因为我已经引入了antd.min.css,所以默认的样式应该也都有。@ant-design/pro-form为什么要再专门创建并添加这些样式呢? 期待结果:@ant-design/pro-form不添加这些默认的样式
antd.min.css
The text was updated successfully, but these errors were encountered:
same problem
Sorry, something went wrong.
import { ProForm } from "@ant-design/pro-components"; proform要这样引入就没有问题
请问解决了吗
No branches or pull requests
🐛 bug 描述
通过cdn的方式引入
antd
和@ant-design/pro-form
,引入成功后,发现原本定制的主题色,被覆盖成了默认的主题色。翻了一下
@ant-design/pro-form
的源码,发现是它在<head>
里插入了很多<style>
,包含默认的样式,导致定制的主题色被覆盖。📷 复现步骤
🏞 期望结果
因为我已经引入了
antd.min.css
,所以默认的样式应该也都有。@ant-design/pro-form
为什么要再专门创建并添加这些样式呢?期待结果:
@ant-design/pro-form
不添加这些默认的样式💻 复现代码
© 版本信息
The text was updated successfully, but these errors were encountered: