@@ -73,6 +73,9 @@ module.exports = {
73
73
// Helpers
74
74
//----------------------------------------------------------------------
75
75
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' ] ;
76
79
// These are shorthand candidates that do not share the same parent type
77
80
const complexEquivalences = [
78
81
{
@@ -85,6 +88,27 @@ module.exports = {
85
88
shorthand : 'size-' ,
86
89
mode : 'value' ,
87
90
} ,
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
+ } ) ,
88
112
] ;
89
113
90
114
// Init assets
@@ -243,7 +267,9 @@ module.exports = {
243
267
}
244
268
// Test if the body of the class matches, eg. 'h-' inside 'h-10'
245
269
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
+ ) ;
247
273
if ( [ undefined , null ] . includes ( mergedConfig . theme . size ) ) {
248
274
return false ;
249
275
}
@@ -362,8 +388,9 @@ module.exports = {
362
388
} else if ( hasY || hasX ) {
363
389
const xOrY = hasX ? 'x' : 'y' ;
364
390
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
+ } `;
367
394
const toBeReplaced = sameVariantAndValue
368
395
. filter ( ( c ) => {
369
396
const candidates = hasX ? [ 'l' , 'r' ] : [ 't' , 'b' ] ;
0 commit comments