@@ -456,7 +456,7 @@ test('Theme function in JS can apply alpha values to colors (1)', () => {
456
456
} )
457
457
} )
458
458
459
- test ( 'TTheme function in JS can apply alpha values to colors (2)' , ( ) => {
459
+ test ( 'Theme function in JS can apply alpha values to colors (2)' , ( ) => {
460
460
let input = css `
461
461
@tailwind utilities;
462
462
`
@@ -484,7 +484,7 @@ test('TTheme function in JS can apply alpha values to colors (2)', () => {
484
484
} )
485
485
} )
486
486
487
- test ( 'TTheme function in JS can apply alpha values to colors (3)' , ( ) => {
487
+ test ( 'Theme function in JS can apply alpha values to colors (3)' , ( ) => {
488
488
let input = css `
489
489
@tailwind utilities;
490
490
`
@@ -512,7 +512,7 @@ test('TTheme function in JS can apply alpha values to colors (3)', () => {
512
512
} )
513
513
} )
514
514
515
- test ( 'TTheme function in JS can apply alpha values to colors (4)' , ( ) => {
515
+ test ( 'Theme function in JS can apply alpha values to colors (4)' , ( ) => {
516
516
let input = css `
517
517
@tailwind utilities;
518
518
`
@@ -540,7 +540,7 @@ test('TTheme function in JS can apply alpha values to colors (4)', () => {
540
540
} )
541
541
} )
542
542
543
- test ( 'TTheme function in JS can apply alpha values to colors (5)' , ( ) => {
543
+ test ( 'Theme function in JS can apply alpha values to colors (5)' , ( ) => {
544
544
let input = css `
545
545
@tailwind utilities;
546
546
`
@@ -568,7 +568,7 @@ test('TTheme function in JS can apply alpha values to colors (5)', () => {
568
568
} )
569
569
} )
570
570
571
- test ( 'TTheme function in JS can apply alpha values to colors (6)' , ( ) => {
571
+ test ( 'Theme function in JS can apply alpha values to colors (6)' , ( ) => {
572
572
let input = css `
573
573
@tailwind utilities;
574
574
`
@@ -596,7 +596,7 @@ test('TTheme function in JS can apply alpha values to colors (6)', () => {
596
596
} )
597
597
} )
598
598
599
- test ( 'TTheme function in JS can apply alpha values to colors (7)' , ( ) => {
599
+ test ( 'Theme function in JS can apply alpha values to colors (7)' , ( ) => {
600
600
let input = css `
601
601
@tailwind utilities;
602
602
`
@@ -627,3 +627,35 @@ test('TTheme function in JS can apply alpha values to colors (7)', () => {
627
627
expect ( result . warnings ( ) . length ) . toBe ( 0 )
628
628
} )
629
629
} )
630
+
631
+ test ( 'Theme function prefers existing values in config' , ( ) => {
632
+ let input = css `
633
+ @tailwind utilities;
634
+ `
635
+
636
+ let output = css `
637
+ .text-foo {
638
+ color: purple;
639
+ }
640
+ `
641
+
642
+ return run ( input , {
643
+ content : [ { raw : html `text-foo` } ] ,
644
+ corePlugins : { textOpacity : false } ,
645
+ theme : {
646
+ colors : {
647
+ blue : {
648
+ '500 / 50%' : 'purple' ,
649
+ } ,
650
+ } ,
651
+ extend : {
652
+ textColor : ( { theme } ) => ( {
653
+ foo : theme ( 'colors.blue.500 / 50%' ) ,
654
+ } ) ,
655
+ } ,
656
+ } ,
657
+ } ) . then ( ( result ) => {
658
+ expect ( result . css ) . toMatchCss ( output )
659
+ expect ( result . warnings ( ) . length ) . toBe ( 0 )
660
+ } )
661
+ } )
0 commit comments