11const svgToDataUri = require ( 'mini-svg-data-uri' )
2- const defaultTheme = require ( 'tailwindcss/defaultTheme' )
2+ const defaultTheme = require ( 'tailwindcss/resolveConfig' ) ( require ( 'tailwindcss/defaultConfig' ) ) . theme
33
44module . exports = function ( { addUtilities, addComponents, theme } ) {
55
@@ -16,8 +16,8 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
1616 focusShadow : defaultTheme . boxShadow . outline ,
1717 checkboxSize : '1em' ,
1818 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>` ,
2121 checkedColor : 'currentColor' ,
2222 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>` ,
2323 selectIconOffset : defaultTheme . spacing [ 2 ] ,
@@ -36,6 +36,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
3636 borderWidth : options . borderWidth ,
3737 borderRadius : options . borderRadius ,
3838 backgroundColor : options . backgroundColor ,
39+ backgroundOrigin : 'border-box' ,
3940 userSelect : 'none' ,
4041 '&:focus' : {
4142 outline : 'none' ,
@@ -48,7 +49,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
4849 backgroundColor : options . checkedColor ,
4950 borderColor : options . checkedColor ,
5051 backgroundImage : `url("${ svgToDataUri ( options . checkboxIcon ) } ")` ,
51- backgroundSize : 'cover ' ,
52+ backgroundSize : '100% 100% ' ,
5253 backgroundPosition : 'center' ,
5354 backgroundRepeat : 'no-repeat' ,
5455 } ,
@@ -70,6 +71,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
7071 borderWidth : options . borderWidth ,
7172 borderRadius : '50%' ,
7273 backgroundColor : options . backgroundColor ,
74+ backgroundOrigin : 'border-box' ,
7375 userSelect : 'none' ,
7476 '&:focus' : {
7577 outline : 'none' ,
@@ -82,7 +84,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
8284 backgroundColor : options . checkedColor ,
8385 borderColor : options . checkedColor ,
8486 backgroundImage : `url("${ svgToDataUri ( options . radioIcon ) } ")` ,
85- backgroundSize : 'cover ' ,
87+ backgroundSize : '100% 100% ' ,
8688 backgroundPosition : 'center' ,
8789 backgroundRepeat : 'no-repeat' ,
8890 } ,
0 commit comments