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
4.0.8
window11
<ConfigProvider :locale="getAntdLocale" :theme="themeConfig"> <AppProvider> <RouterView /> </AppProvider> </ConfigProvider>
const themeConfig = computed(() => Object.assign( { token: { colorBgElevated: 'red', // 设置这个,才可以使得headerBg生效 }, components: { Modal: { colorText: 'red', // 生效 headerBg: 'blue', // 单设置这个,没有效果 }, }, }, isDark.value ? darkTheme : {}, ), );
简单看了下源码
const modalToken = (0, _internal.mergeToken)(token, { modalBodyPadding: token.paddingLG, modalHeaderBg: token.colorBgElevated,
[`${componentCls}-header`]: { color: token.colorText, background: token.modalHeaderBg,
取上面的token.colorBgElevated,而不是外面传进来headerBg
如果这样的话,3.x升级到4.x这个样式设置成本有点大,原以为可以把less之前设置的,放到theme,结果不是每个都可以。
现在的解决方案是:新建less文件,写样式取之前less设置过的,但是有点低效,求一个切换成本低的方法。
只设置headerBg能覆盖样式。像之前3.x的时候在vite.config设置'modal-header-bg': 'blue'可以覆盖样式
没有效果
The text was updated successfully, but these errors were encountered:
react版设置的比较精细,基本每个组件都可以单独设置,vue版不如3.x好用
Sorry, something went wrong.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Version
4.0.8
Environment
window11
Reproduction link
Steps to reproduce
简单看了下源码
取上面的token.colorBgElevated,而不是外面传进来headerBg
如果这样的话,3.x升级到4.x这个样式设置成本有点大,原以为可以把less之前设置的,放到theme,结果不是每个都可以。
现在的解决方案是:新建less文件,写样式取之前less设置过的,但是有点低效,求一个切换成本低的方法。
What is expected?
只设置headerBg能覆盖样式。像之前3.x的时候在vite.config设置'modal-header-bg': 'blue'可以覆盖样式
What is actually happening?
没有效果
The text was updated successfully, but these errors were encountered: