1
1
const svgToDataUri = require ( 'mini-svg-data-uri' )
2
- const defaultTheme = require ( 'tailwindcss/defaultTheme' )
2
+ const defaultTheme = require ( 'tailwindcss/resolveConfig' ) ( require ( 'tailwindcss/defaultConfig' ) ) . theme
3
3
4
4
module . exports = function ( { addUtilities, addComponents, theme } ) {
5
5
@@ -16,8 +16,8 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
16
16
focusShadow : defaultTheme . boxShadow . outline ,
17
17
checkboxSize : '1em' ,
18
18
radioSize : '1em' ,
19
- checkboxIcon : `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#fff" ><path d="M13.293 4 .293a1 1 0 0 1 0 1.414L7 12a1 1 0 0 1-1 .414 0L3.293 9.707a1 1 0 0 1 1 .414-1.414l1.586 1 .586 5.586-5.586a1 1 0 0 1 1.414 0z "/></svg>` ,
20
- radioIcon : `<svg viewBox="0 0 24 24 " fill="#fff" xmlns="http://www.w3.org/2000/svg"><circle cx="12 " cy="12 " r="5 "/></svg>` ,
19
+ checkboxIcon : `<svg viewBox="0 0 16 16" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M5.707 7 .293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1 .414 0l4-4a1 1 0 0 0-1 .414-1.414L7 8 .586 5.707 7.293z "/></svg>` ,
20
+ radioIcon : `<svg viewBox="0 0 16 16 " fill="#fff" xmlns="http://www.w3.org/2000/svg"><circle cx="8 " cy="8 " r="3 "/></svg>` ,
21
21
checkedColor : 'currentColor' ,
22
22
selectIcon : `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="${ defaultTheme . colors . gray [ 500 ] } "><path d="M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"/></svg>` ,
23
23
selectIconOffset : defaultTheme . spacing [ 2 ] ,
@@ -36,6 +36,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
36
36
borderWidth : options . borderWidth ,
37
37
borderRadius : options . borderRadius ,
38
38
backgroundColor : options . backgroundColor ,
39
+ backgroundOrigin : 'border-box' ,
39
40
userSelect : 'none' ,
40
41
'&:focus' : {
41
42
outline : 'none' ,
@@ -48,7 +49,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
48
49
backgroundColor : options . checkedColor ,
49
50
borderColor : options . checkedColor ,
50
51
backgroundImage : `url("${ svgToDataUri ( options . checkboxIcon ) } ")` ,
51
- backgroundSize : 'cover ' ,
52
+ backgroundSize : '100% 100% ' ,
52
53
backgroundPosition : 'center' ,
53
54
backgroundRepeat : 'no-repeat' ,
54
55
} ,
@@ -70,6 +71,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
70
71
borderWidth : options . borderWidth ,
71
72
borderRadius : '50%' ,
72
73
backgroundColor : options . backgroundColor ,
74
+ backgroundOrigin : 'border-box' ,
73
75
userSelect : 'none' ,
74
76
'&:focus' : {
75
77
outline : 'none' ,
@@ -82,7 +84,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
82
84
backgroundColor : options . checkedColor ,
83
85
borderColor : options . checkedColor ,
84
86
backgroundImage : `url("${ svgToDataUri ( options . radioIcon ) } ")` ,
85
- backgroundSize : 'cover ' ,
87
+ backgroundSize : '100% 100% ' ,
86
88
backgroundPosition : 'center' ,
87
89
backgroundRepeat : 'no-repeat' ,
88
90
} ,
0 commit comments