mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-05 19:41:37 +08:00
fix: components's style overlay problem when toggle theme color. (切换主题色时组件样式覆盖问题。)
fixes #78
This commit is contained in:
parent
19fc285134
commit
2382dd8abc
@ -23,5 +23,29 @@ module.exports = {
|
|||||||
let promise = client.changer.changeColor(options)
|
let promise = client.changer.changeColor(options)
|
||||||
this.lastColor = lastColor
|
this.lastColor = lastColor
|
||||||
return promise
|
return promise
|
||||||
|
},
|
||||||
|
changeSelector (selector) {
|
||||||
|
switch (selector) {
|
||||||
|
case '.ant-calendar-today .ant-calendar-date':
|
||||||
|
return ':not(.ant-calendar-selected-date):not(.ant-calendar-selected-day)' + selector
|
||||||
|
case '.ant-btn:focus,.ant-btn:hover':
|
||||||
|
return '.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger)'
|
||||||
|
case '.ant-btn.active,.ant-btn:active':
|
||||||
|
return '.ant-btn.active:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:active:not(.ant-btn-primary):not(.ant-btn-danger)'
|
||||||
|
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
|
||||||
|
case '.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon':
|
||||||
|
return ':not(.ant-steps-item-process)' + selector
|
||||||
|
case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover':
|
||||||
|
case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover':
|
||||||
|
return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover'
|
||||||
|
case '.ant-menu-horizontal > .ant-menu-item-selected > a':
|
||||||
|
case '.ant-menu-horizontal>.ant-menu-item-selected>a':
|
||||||
|
return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item-selected > a'
|
||||||
|
case '.ant-menu-horizontal > .ant-menu-item > a:hover':
|
||||||
|
case '.ant-menu-horizontal>.ant-menu-item>a:hover':
|
||||||
|
return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item > a:hover'
|
||||||
|
default :
|
||||||
|
return selector
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
let path = require('path')
|
let path = require('path')
|
||||||
const ThemeColorReplacer = require('webpack-theme-color-replacer')
|
const ThemeColorReplacer = require('webpack-theme-color-replacer')
|
||||||
const getThemeColors = require('./src/utils/themeUtil').getThemeColors
|
const {getThemeColors, changeSelector} = require('./src/utils/themeUtil')
|
||||||
const themeColor = require('./src/config').themeColor
|
const themeColor = require('./src/config').themeColor
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new ThemeColorReplacer({
|
new ThemeColorReplacer({
|
||||||
fileName: 'css/theme-colors.css',
|
fileName: 'css/theme-colors.css',
|
||||||
matchColors: getThemeColors(themeColor)
|
matchColors: getThemeColors(themeColor),
|
||||||
|
changeSelector
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user