File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1+ const numberRegex = require ( "./util/numberRegex" ) ;
2+
13module . exports = function ( { matchUtilities, theme } ) {
4+ const values = theme ( "inset" ) ;
25 const calculatedValues = { } ;
6+ const keywords = [ "auto" ] ;
37
4- for ( const property in theme ( "inset" ) ) {
8+ for ( const property in values ) {
59 if ( property === "px" ) {
610 calculatedValues [ property ] = "1px" ;
711 } else if ( property === "full" ) {
812 calculatedValues [ property ] = "100%" ;
9- } else if ( property === "auto" ) {
10- calculatedValues [ property ] = "auto" ;
13+ } else if (
14+ keywords . includes ( property ) ||
15+ ( ! numberRegex . test ( property ) && values [ property ] )
16+ ) {
17+ calculatedValues [ property ] = values [ property ] ;
1118 } else if ( property . includes ( "/" ) ) {
1219 calculatedValues [ property ] = `calc(${ property } * 100%)` ;
1320 } else {
Original file line number Diff line number Diff line change 1+ const numberRegex = require ( "./util/numberRegex" ) ;
2+
13module . exports = function ( { addUtilities, matchUtilities, theme } ) {
4+ const values = theme ( "margin" ) ;
25 const calculatedValues = { } ;
36
4- for ( const property in theme ( "margin" ) ) {
7+ for ( const property in values ) {
58 if ( property === "px" ) {
69 calculatedValues [ property ] = "1px" ;
10+ } else if ( ! numberRegex . test ( property ) && values [ property ] ) {
11+ calculatedValues [ property ] = values [ property ] ;
712 } else {
813 calculatedValues [ property ] = `calc(var(--spacing) * ${ property } )` ;
914 }
You can’t perform that action at this time.
0 commit comments