@@ -74,16 +74,9 @@ export const getDefaultConfig = () => {
74
74
] as const
75
75
const scaleOverflow = ( ) => [ 'auto' , 'hidden' , 'clip' , 'visible' , 'scroll' ] as const
76
76
const scaleOverscroll = ( ) => [ 'auto' , 'contain' , 'none' ] as const
77
- const scaleInset = ( ) =>
78
- [
79
- isFraction ,
80
- 'px' ,
81
- 'full' ,
82
- 'auto' ,
83
- isArbitraryVariable ,
84
- isArbitraryValue ,
85
- themeSpacing ,
86
- ] as const
77
+ const scaleUnambiguousSpacing = ( ) =>
78
+ [ isArbitraryVariable , isArbitraryValue , themeSpacing ] as const
79
+ const scaleInset = ( ) => [ isFraction , 'full' , 'auto' , ...scaleUnambiguousSpacing ( ) ] as const
87
80
const scaleGridTemplateColsRows = ( ) =>
88
81
[ isInteger , 'none' , 'subgrid' , isArbitraryVariable , isArbitraryValue ] as const
89
82
const scaleGridColRowStartAndEnd = ( ) =>
@@ -97,19 +90,14 @@ export const getDefaultConfig = () => {
97
90
[ isInteger , 'auto' , isArbitraryVariable , isArbitraryValue ] as const
98
91
const scaleGridAutoColsRows = ( ) =>
99
92
[ 'auto' , 'min' , 'max' , 'fr' , isArbitraryVariable , isArbitraryValue ] as const
100
- const scaleGap = ( ) => [ isArbitraryVariable , isArbitraryValue , themeSpacing ] as const
101
93
const scaleAlignPrimaryAxis = ( ) =>
102
94
[ 'start' , 'end' , 'center' , 'between' , 'around' , 'evenly' , 'stretch' , 'baseline' ] as const
103
95
const scaleAlignSecondaryAxis = ( ) => [ 'start' , 'end' , 'center' , 'stretch' ] as const
104
- const scaleUnambiguousSpacing = ( ) =>
105
- [ isArbitraryVariable , isArbitraryValue , themeSpacing ] as const
106
- const scalePadding = ( ) => [ 'px' , ...scaleUnambiguousSpacing ( ) ]
107
- const scaleMargin = ( ) => [ 'px' , 'auto' , ...scaleUnambiguousSpacing ( ) ] as const
96
+ const scaleMargin = ( ) => [ 'auto' , ...scaleUnambiguousSpacing ( ) ] as const
108
97
const scaleSizing = ( ) =>
109
98
[
110
99
isFraction ,
111
100
'auto' ,
112
- 'px' ,
113
101
'full' ,
114
102
'dvw' ,
115
103
'dvh' ,
@@ -120,9 +108,7 @@ export const getDefaultConfig = () => {
120
108
'min' ,
121
109
'max' ,
122
110
'fit' ,
123
- isArbitraryVariable ,
124
- isArbitraryValue ,
125
- themeSpacing ,
111
+ ...scaleUnambiguousSpacing ( ) ,
126
112
] as const
127
113
const scaleColor = ( ) => [ themeColor , isArbitraryVariable , isArbitraryValue ] as const
128
114
const scaleGradientStopPosition = ( ) => [ isPercent , isArbitraryLength ] as const
@@ -184,8 +170,7 @@ export const getDefaultConfig = () => {
184
170
const scaleRotate = ( ) => [ 'none' , isNumber , isArbitraryVariable , isArbitraryValue ] as const
185
171
const scaleScale = ( ) => [ 'none' , isNumber , isArbitraryVariable , isArbitraryValue ] as const
186
172
const scaleSkew = ( ) => [ isNumber , isArbitraryVariable , isArbitraryValue ] as const
187
- const scaleTranslate = ( ) =>
188
- [ isFraction , 'full' , 'px' , isArbitraryVariable , isArbitraryValue , themeSpacing ] as const
173
+ const scaleTranslate = ( ) => [ isFraction , 'full' , ...scaleUnambiguousSpacing ( ) ] as const
189
174
190
175
return {
191
176
cacheSize : 500 ,
@@ -215,7 +200,7 @@ export const getDefaultConfig = () => {
215
200
perspective : [ 'dramatic' , 'near' , 'normal' , 'midrange' , 'distant' , 'none' ] ,
216
201
radius : [ isTshirtSize ] ,
217
202
shadow : [ isTshirtSize ] ,
218
- spacing : [ isNumber ] ,
203
+ spacing : [ 'px' , isNumber ] ,
219
204
text : [ isTshirtSize ] ,
220
205
tracking : [ 'tighter' , 'tight' , 'normal' , 'wide' , 'wider' , 'widest' ] ,
221
206
} ,
@@ -442,10 +427,8 @@ export const getDefaultConfig = () => {
442
427
isFraction ,
443
428
'full' ,
444
429
'auto' ,
445
- isArbitraryVariable ,
446
- isArbitraryValue ,
447
430
themeContainer ,
448
- themeSpacing ,
431
+ ... scaleUnambiguousSpacing ( ) ,
449
432
] ,
450
433
} ,
451
434
] ,
@@ -549,17 +532,17 @@ export const getDefaultConfig = () => {
549
532
* Gap
550
533
* @see https://tailwindcss.com/docs/gap
551
534
*/
552
- gap : [ { gap : scaleGap ( ) } ] ,
535
+ gap : [ { gap : scaleUnambiguousSpacing ( ) } ] ,
553
536
/**
554
537
* Gap X
555
538
* @see https://tailwindcss.com/docs/gap
556
539
*/
557
- 'gap-x' : [ { 'gap-x' : scaleGap ( ) } ] ,
540
+ 'gap-x' : [ { 'gap-x' : scaleUnambiguousSpacing ( ) } ] ,
558
541
/**
559
542
* Gap Y
560
543
* @see https://tailwindcss.com/docs/gap
561
544
*/
562
- 'gap-y' : [ { 'gap-y' : scaleGap ( ) } ] ,
545
+ 'gap-y' : [ { 'gap-y' : scaleUnambiguousSpacing ( ) } ] ,
563
546
/**
564
547
* Justify Content
565
548
* @see https://tailwindcss.com/docs/justify-content
@@ -610,47 +593,47 @@ export const getDefaultConfig = () => {
610
593
* Padding
611
594
* @see https://tailwindcss.com/docs/padding
612
595
*/
613
- p : [ { p : scalePadding ( ) } ] ,
596
+ p : [ { p : scaleUnambiguousSpacing ( ) } ] ,
614
597
/**
615
598
* Padding X
616
599
* @see https://tailwindcss.com/docs/padding
617
600
*/
618
- px : [ { px : scalePadding ( ) } ] ,
601
+ px : [ { px : scaleUnambiguousSpacing ( ) } ] ,
619
602
/**
620
603
* Padding Y
621
604
* @see https://tailwindcss.com/docs/padding
622
605
*/
623
- py : [ { py : scalePadding ( ) } ] ,
606
+ py : [ { py : scaleUnambiguousSpacing ( ) } ] ,
624
607
/**
625
608
* Padding Start
626
609
* @see https://tailwindcss.com/docs/padding
627
610
*/
628
- ps : [ { ps : scalePadding ( ) } ] ,
611
+ ps : [ { ps : scaleUnambiguousSpacing ( ) } ] ,
629
612
/**
630
613
* Padding End
631
614
* @see https://tailwindcss.com/docs/padding
632
615
*/
633
- pe : [ { pe : scalePadding ( ) } ] ,
616
+ pe : [ { pe : scaleUnambiguousSpacing ( ) } ] ,
634
617
/**
635
618
* Padding Top
636
619
* @see https://tailwindcss.com/docs/padding
637
620
*/
638
- pt : [ { pt : scalePadding ( ) } ] ,
621
+ pt : [ { pt : scaleUnambiguousSpacing ( ) } ] ,
639
622
/**
640
623
* Padding Right
641
624
* @see https://tailwindcss.com/docs/padding
642
625
*/
643
- pr : [ { pr : scalePadding ( ) } ] ,
626
+ pr : [ { pr : scaleUnambiguousSpacing ( ) } ] ,
644
627
/**
645
628
* Padding Bottom
646
629
* @see https://tailwindcss.com/docs/padding
647
630
*/
648
- pb : [ { pb : scalePadding ( ) } ] ,
631
+ pb : [ { pb : scaleUnambiguousSpacing ( ) } ] ,
649
632
/**
650
633
* Padding Left
651
634
* @see https://tailwindcss.com/docs/padding
652
635
*/
653
- pl : [ { pl : scalePadding ( ) } ] ,
636
+ pl : [ { pl : scaleUnambiguousSpacing ( ) } ] ,
654
637
/**
655
638
* Margin
656
639
* @see https://tailwindcss.com/docs/margin
@@ -881,11 +864,9 @@ export const getDefaultConfig = () => {
881
864
leading : [
882
865
{
883
866
leading : [
884
- isArbitraryVariable ,
885
- isArbitraryValue ,
886
867
/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
887
868
themeLeading ,
888
- themeSpacing ,
869
+ ... scaleUnambiguousSpacing ( ) ,
889
870
] ,
890
871
} ,
891
872
] ,
@@ -978,7 +959,7 @@ export const getDefaultConfig = () => {
978
959
* Text Indent
979
960
* @see https://tailwindcss.com/docs/text-indent
980
961
*/
981
- indent : [ { indent : [ 'px' , ... scaleUnambiguousSpacing ( ) ] } ] ,
962
+ indent : [ { indent : scaleUnambiguousSpacing ( ) } ] ,
982
963
/**
983
964
* Vertical Alignment
984
965
* @see https://tailwindcss.com/docs/vertical-align
0 commit comments