@@ -73,6 +73,9 @@ module.exports = {
7373 // Helpers
7474 //----------------------------------------------------------------------
7575
76+ const placeContentOptions = [ 'center' , 'start' , 'end' , 'between' , 'around' , 'evenly' , 'baseline' , 'stretch' ] ;
77+ const placeItemsOptions = [ 'start' , 'end' , 'center' , 'stretch' ] ;
78+ const placeSelfOptions = [ 'auto' , 'start' , 'end' , 'center' , 'stretch' ] ;
7679 // These are shorthand candidates that do not share the same parent type
7780 const complexEquivalences = [
7881 {
@@ -85,6 +88,27 @@ module.exports = {
8588 shorthand : 'size-' ,
8689 mode : 'value' ,
8790 } ,
91+ ...placeContentOptions . map ( ( opt ) => {
92+ return {
93+ needles : [ `content-${ opt } ` , `justify-${ opt } ` ] ,
94+ shorthand : `place-content-${ opt } ` ,
95+ mode : 'exact' ,
96+ } ;
97+ } ) ,
98+ ...placeItemsOptions . map ( ( opt ) => {
99+ return {
100+ needles : [ `items-${ opt } ` , `justify-items-${ opt } ` ] ,
101+ shorthand : `place-items-${ opt } ` ,
102+ mode : 'exact' ,
103+ } ;
104+ } ) ,
105+ ...placeSelfOptions . map ( ( opt ) => {
106+ return {
107+ needles : [ `self-${ opt } ` , `justify-self-${ opt } ` ] ,
108+ shorthand : `place-self-${ opt } ` ,
109+ mode : 'exact' ,
110+ } ;
111+ } ) ,
88112 ] ;
89113
90114 // Init assets
@@ -243,7 +267,9 @@ module.exports = {
243267 }
244268 // Test if the body of the class matches, eg. 'h-' inside 'h-10'
245269 if ( mode === 'value' ) {
246- const bodyMatch = inputSet . some ( ( inputClassPattern ) => `${ mergedConfig . prefix } ${ inputClassPattern } ` === remainingClass . body ) ;
270+ const bodyMatch = inputSet . some (
271+ ( inputClassPattern ) => `${ mergedConfig . prefix } ${ inputClassPattern } ` === remainingClass . body
272+ ) ;
247273 if ( [ undefined , null ] . includes ( mergedConfig . theme . size ) ) {
248274 return false ;
249275 }
@@ -362,8 +388,9 @@ module.exports = {
362388 } else if ( hasY || hasX ) {
363389 const xOrY = hasX ? 'x' : 'y' ;
364390 const xOrYType = getBodyByShorthand ( targetGroups , classname . parentType , xOrY ) ;
365- const patchedName = `${ cls . variants } ${ important } ${ minus } ${ mergedConfig . prefix } ${ xOrYType } ${ absoluteVal . length ? '-' + absoluteVal : ''
366- } `;
391+ const patchedName = `${ cls . variants } ${ important } ${ minus } ${ mergedConfig . prefix } ${ xOrYType } ${
392+ absoluteVal . length ? '-' + absoluteVal : ''
393+ } `;
367394 const toBeReplaced = sameVariantAndValue
368395 . filter ( ( c ) => {
369396 const candidates = hasX ? [ 'l' , 'r' ] : [ 't' , 'b' ] ;
0 commit comments