@@ -7,37 +7,37 @@ const getSize = (options, theme) => {
77 return theme ( 'scrollbar.DEFAULT.size' , '5px' ) // with config
88}
99const getStyleTrack = ( options , theme ) => {
10- const background = '#f1f1f1'
11- const fromConfig = { // with config
12- background,
13- darkBackground : background ,
14- ...theme ( 'scrollbar.DEFAULT.track' , { } ) ,
10+ const defaultBackground = '#f1f1f1'
11+ const defaultConfig = {
12+ background : defaultBackground ,
13+ darkBackground : defaultBackground ,
1514 }
16- const fromOptions = options && options . track ? options . track : { } // with plugin options
15+ const fromConfig = theme ( 'scrollbar.DEFAULT.track' , { } ) // with tailwind.config.js
16+ const fromOptions = ( options && options . track ) ? options . track : { } // with plugin options
1717
18- return { ...fromConfig , ...fromOptions }
18+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
1919}
2020const getStyleThumb = ( options , theme ) => {
21- const background = '#c1c1c1'
22- const fromConfig = { // with config
23- background,
24- darkBackground : background ,
25- ...theme ( 'scrollbar.DEFAULT.thumb' , { } ) ,
21+ const defaultBackground = '#c1c1c1'
22+ const defaultConfig = {
23+ background : defaultBackground ,
24+ darkBackground : defaultBackground ,
2625 }
27- const fromOptions = options && options . thumb ? options . thumb : { } // with plugin options
26+ const fromConfig = theme ( 'scrollbar.DEFAULT.thumb' , { } ) // with tailwind.config.js
27+ const fromOptions = ( options && options . thumb ) ? options . thumb : { } // with plugin options
2828
29- return { ...fromConfig , ...fromOptions }
29+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
3030}
3131const getStyleThumbHover = ( options , theme ) => {
32- const background = '#a8a8a8'
33- const fromConfig = { // with config
34- background,
35- darkBackground : background ,
36- ...theme ( 'scrollbar.DEFAULT.hover' , { } ) ,
32+ const defaultBackground = '#a8a8a8'
33+ const defaultConfig = {
34+ background : defaultBackground ,
35+ darkBackground : defaultBackground ,
3736 }
38- const fromOptions = options && options . hover ? options . hover : { } // with plugin options
37+ const fromConfig = theme ( 'scrollbar.DEFAULT.hover' , { } ) // with tailwind.config.js
38+ const fromOptions = ( options && options . hover ) ? options . hover : { } // with plugin options
3939
40- return { ...fromConfig , ...fromOptions }
40+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
4141}
4242
4343module . exports = plugin . withOptions ( function ( options ) {
0 commit comments