@@ -17518,6 +17518,43 @@ describe('custom utilities', () => {
17518
17518
expect ( await compileCss ( input , [ 'tab-3' , 'tab-gitlab' ] ) ) . toEqual ( '' )
17519
17519
} )
17520
17520
17521
+ test ( 'resolving values from `@theme`, with `--tab-size-\\*` syntax (prettier friendly)' , async ( ) => {
17522
+ let input = css `
17523
+ @theme reference {
17524
+ --tab-size-1 : 1 ;
17525
+ --tab-size-2 : 2 ;
17526
+ --tab-size-4 : 4 ;
17527
+ --tab-size-github : 8 ;
17528
+ }
17529
+
17530
+ @utility tab-* {
17531
+ tab-size : --value (--tab-size- \*);
17532
+ }
17533
+
17534
+ @tailwind utilities;
17535
+ `
17536
+
17537
+ expect ( await compileCss ( input , [ 'tab-1' , 'tab-2' , 'tab-4' , 'tab-github' ] ) )
17538
+ . toMatchInlineSnapshot ( `
17539
+ ".tab-1 {
17540
+ tab-size: 1;
17541
+ }
17542
+
17543
+ .tab-2 {
17544
+ tab-size: 2;
17545
+ }
17546
+
17547
+ .tab-4 {
17548
+ tab-size: 4;
17549
+ }
17550
+
17551
+ .tab-github {
17552
+ tab-size: 8;
17553
+ }"
17554
+ ` )
17555
+ expect ( await compileCss ( input , [ 'tab-3' , 'tab-gitlab' ] ) ) . toEqual ( '' )
17556
+ } )
17557
+
17521
17558
test ( 'resolving bare values' , async ( ) => {
17522
17559
let input = css `
17523
17560
@utility tab-* {
@@ -17981,6 +18018,36 @@ describe('custom utilities', () => {
17981
18018
expect ( await compileCss ( input , [ 'example-foo' , 'example-xs/foo' ] ) ) . toEqual ( '' )
17982
18019
} )
17983
18020
18021
+ test ( 'resolve theme values with sub-namespace (--text-\\* --line-height)' , async ( ) => {
18022
+ let input = css `
18023
+ @theme reference {
18024
+ --text-xs : 0.75rem ;
18025
+ --text-xs--line-height : calc (1 / 0.75 );
18026
+ }
18027
+
18028
+ @utility example-* {
18029
+ font-size : --value (--text );
18030
+ line-height : --value (--text- \* --line-height );
18031
+ line-height : --modifier (number);
18032
+ }
18033
+
18034
+ @tailwind utilities;
18035
+ `
18036
+
18037
+ expect ( await compileCss ( input , [ 'example-xs' , 'example-xs/6' ] ) ) . toMatchInlineSnapshot ( `
18038
+ ".example-xs {
18039
+ font-size: .75rem;
18040
+ line-height: 1.33333;
18041
+ }
18042
+
18043
+ .example-xs\\/6 {
18044
+ font-size: .75rem;
18045
+ line-height: 6;
18046
+ }"
18047 + ` )
18048
+ expect ( await compileCss ( input , [ 'example-foo' , 'example-xs/foo' ] ) ) . toEqual ( '' )
18049
+ } )
18050
+
17984
18051
test ( 'resolve theme values with sub-namespace (--value(--text --line-height))' , async ( ) => {
17985
18052
let input = css `
17986
18053
@theme reference {
0 commit comments