File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
src/components/SettingDrawer Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 57
57
"opencollective-postinstall" : " ^2.0.2" ,
58
58
"vue-svg-icon-loader" : " ^2.1.1" ,
59
59
"vue-template-compiler" : " ^2.5.22" ,
60
- "webpack-theme-color-replacer" : " ^1.1.5 "
60
+ "webpack-theme-color-replacer" : " ^1.2.15 "
61
61
},
62
62
"eslintConfig" : {
63
63
"root" : true ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import client from 'webpack-theme-color-replacer/client'
2
2
import generate from '@ant-design/colors/lib/generate'
3
3
4
4
export default {
5
- primaryColor : '#1890ff' , // TODO 需要处理的暗坑
6
5
getAntdSerials ( color ) {
7
6
// 淡化(即less的tint)
8
7
const lightens = new Array ( 9 ) . fill ( ) . map ( ( t , i ) => {
@@ -13,14 +12,12 @@ export default {
13
12
return lightens . concat ( colorPalettes )
14
13
} ,
15
14
changeColor ( newColor ) {
16
- var lastColor = this . lastColor || this . primaryColor
17
15
var options = {
18
- cssUrl : '/css/theme-colors.css' , // TODO 需要处理的暗坑
19
- oldColors : this . getAntdSerials ( lastColor ) , // current colors array. The same as `matchColors`
20
- newColors : this . getAntdSerials ( newColor ) // new colors array, one-to-one corresponde with `oldColors`
16
+ newColors : this . getAntdSerials ( newColor ) , // new colors array, one-to-one corresponde with `matchColors`
17
+ changeUrl ( cssUrl ) {
18
+ return `/${ cssUrl } ` // while router is not `hash` mode, it needs absolute path
19
+ }
21
20
}
22
- var promise = client . changer . changeColor ( options , Promise )
23
- this . lastColor = lastColor
24
- return promise
21
+ return client . changer . changeColor ( options , Promise )
25
22
}
26
23
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = {
16
16
// 生成仅包含颜色的替换样式(主题色等)
17
17
// TODO 需要增加根据环境不开启主题需求
18
18
new ThemeColorReplacer ( {
19
- fileName : 'css/theme-colors.css' , // TODO 需要处理的暗坑
19
+ fileName : 'css/theme-colors-[contenthash:8] .css' ,
20
20
matchColors : getAntdSerials ( '#1890ff' ) , // 主色系列
21
21
// 改变样式选择器,解决样式覆盖问题
22
22
changeSelector ( selector ) {
You can’t perform that action at this time.
0 commit comments