File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module.exports = {
77 lang : 'en-US' ,
88 head : [ ] ,
99 themeConfig : {
10+ themeColors : null ,
1011 repo : null ,
1112 docsRepo : null ,
1213 docsDir : 'docs' ,
@@ -20,6 +21,6 @@ module.exports = {
2021 showBackToTop : true ,
2122 maxTocDeep : 3 ,
2223 search : true ,
23- searchMaxSuggestions : 10 ,
24- } ,
24+ searchMaxSuggestions : 10
25+ }
2526} ;
Original file line number Diff line number Diff line change 1- const { resolveLayouts } = require ( '../util' ) ;
1+ const { resolveLayouts, setThemeColors } = require ( '../util' ) ;
22
33module . exports = ( { stage, actions, loaders } ) => {
44 resolveLayouts ( actions ) ;
5+ setThemeColors ( actions ) ;
6+
57 if ( stage === 'develop' ) {
68 actions . setWebpackConfig ( {
79 module : {
810 rules : [
911 {
1012 test : / r e a c t - h o t - l o a d e r / ,
11- use : [ loaders . js ( ) ] ,
12- } ,
13- ] ,
14- } ,
13+ use : [ loaders . js ( ) ]
14+ }
15+ ]
16+ }
1517 } ) ;
1618 }
1719} ;
Original file line number Diff line number Diff line change @@ -117,9 +117,35 @@ module.exports.resolveLayouts = function(actions) {
117117 actions . setWebpackConfig ( {
118118 resolve : {
119119 alias : {
120- [ `antdsite-${ layout } ` ] : layoutPath ,
121- } ,
122- } ,
120+ [ `antdsite-${ layout } ` ] : layoutPath
121+ }
122+ }
123123 } ) ;
124124 } ) ;
125125} ;
126+
127+ module . exports . setThemeColors = function ( actions ) {
128+ const config = module . exports . getFinalConfig ( ) ;
129+ const { themeColors } = config . themeConfig ;
130+
131+ if ( themeColors ) {
132+ actions . setWebpackConfig ( {
133+ module : {
134+ rules : [
135+ {
136+ test : / \. l e s s $ / ,
137+ use : [
138+ {
139+ loader : 'less-loader' , // compiles Less to CSS
140+ options : {
141+ modifyVars : themeColors ,
142+ javascriptEnabled : true
143+ }
144+ }
145+ ]
146+ }
147+ ]
148+ }
149+ } ) ;
150+ }
151+ } ;
Original file line number Diff line number Diff line change 145145.drawer {
146146 z-index : 1029 ;
147147}
148+
149+ // fix back-top icon background-size 1% bug when modifying the theme.
150+ .ant-back-top-icon {
151+ background-size : 100% 100% !important ;
152+ }
You can’t perform that action at this time.
0 commit comments