@@ -7,37 +7,37 @@ const getSize = (options, theme) => {
7
7
return theme ( 'scrollbar.DEFAULT.size' , '5px' ) // with config
8
8
}
9
9
const 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 ,
15
14
}
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
17
17
18
- return { ...fromConfig , ...fromOptions }
18
+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
19
19
}
20
20
const 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 ,
26
25
}
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
28
28
29
- return { ...fromConfig , ...fromOptions }
29
+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
30
30
}
31
31
const 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 ,
37
36
}
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
39
39
40
- return { ...fromConfig , ...fromOptions }
40
+ return { ...defaultConfig , ... fromConfig , ...fromOptions }
41
41
}
42
42
43
43
module . exports = plugin . withOptions ( function ( options ) {
0 commit comments