fix: style problem of checkbox component when switching themes; 🐛

修复:切换主题时 checkbox 的样式问题;
master
iczer 4 years ago
parent 4ce9622589
commit cfd334a4b4
  1. 7
      src/config/replacer/resolve.config.js
  2. 7
      src/utils/theme-color-replacer-extend.js

@ -13,7 +13,12 @@
* 注意: value 不能设置为 true
*/
const cssResolve = {
'.ant-checkbox-checked .ant-checkbox-inner::after': false,
'.ant-checkbox-checked .ant-checkbox-inner::after': {
resolve(cssText, cssObj) {
cssObj.rules.push('border-top:0', 'border-left:0')
return cssObj.toText()
}
},
'.ant-menu-dark .ant-menu-inline.ant-menu-sub': {
resolve(cssText, cssObj) {
cssObj.rules = cssObj.rules.filter(rule => rule.indexOf('box-shadow') == -1)

@ -26,8 +26,11 @@ function resolveCss(output, srcArr) {
// 转换为 css 对象
let cssObj = parseCssObj(text)
// 根据selector匹配配置,匹配成功,则按配置处理 css
if (cssResolve[cssObj.selector]) {
outArr.push(cssResolve[cssObj.selector].resolve(text, cssObj))
if (cssResolve[cssObj.selector] != undefined) {
let cfg = cssResolve[cssObj.selector]
if (cfg) {
outArr.push(cfg.resolve(text, cssObj))
}
} else {
let cssText = ''
// 匹配不成功,则测试是否有匹配的正则配置,有则按正则对应的配置处理

Loading…
Cancel
Save