@@ -679,6 +679,74 @@ it('should support aria variants', () => {
679
679
} )
680
680
} )
681
681
682
+ fit ( 'should support data variants' , ( ) => {
683
+ let config = {
684
+ theme : {
685
+ data : {
686
+ checked : 'ui~="checked"' ,
687
+ } ,
688
+ } ,
689
+ content : [
690
+ {
691
+ raw : html `
692
+ <div>
693
+ <div class= "data-checked:underline" > </ div>
694
+ <div class= "data-[position=top]:underline" > </ div>
695
+ <div class= "group-data-checked:underline" > </ div>
696
+ <div class= "peer-data-checked:underline" > </ div>
697
+ <div class= "group-data-checked/foo:underline" > </ div>
698
+ <div class= "peer-data-checked/foo:underline" > </ div>
699
+ <div class= "group-data-[position=top]:underline" > </ div>
700
+ <div class= "peer-data-[position=top]:underline" > </ div>
701
+ <div class= "group-data-[position=top]/foo:underline" > </ div>
702
+ <div class= "peer-data-[position=top]/foo:underline" > </ div>
703
+ </ div>
704
+ ` ,
705
+ } ,
706
+ ] ,
707
+ corePlugins : { preflight : false } ,
708
+ }
709
+
710
+ let input = css `
711
+ @tailwind utilities;
712
+ `
713
+
714
+ return run ( input , config ) . then ( ( result ) => {
715
+ expect ( result . css ) . toMatchFormattedCss ( css `
716
+ .data-checked\:underline [data-ui ~= 'checked' ] {
717
+ text-decoration-line : underline;
718
+ }
719
+ .data-\[position\=top\]\:underline [data-position = 'top' ] {
720
+ text-decoration-line : underline;
721
+ }
722
+ .group [data-ui ~= 'checked' ] .group-data-checked\:underline {
723
+ text-decoration-line : underline;
724
+ }
725
+ .group\/foo [data-ui ~= 'checked' ] .group-data-checked\/foo\:underline {
726
+ text-decoration-line : underline;
727
+ }
728
+ .group [data-position = 'top' ] .group-data-\[position\=top\]\:underline {
729
+ text-decoration-line : underline;
730
+ }
731
+ .group\/foo [data-position = 'top' ] .group-data-\[position\=top\]\/foo\:underline {
732
+ text-decoration-line : underline;
733
+ }
734
+ .peer [data-ui ~= 'checked' ] ~ .peer-data-checked\:underline {
735
+ text-decoration-line : underline;
736
+ }
737
+ .peer\/foo [data-ui ~= 'checked' ] ~ .peer-data-checked\/foo\:underline {
738
+ text-decoration-line : underline;
739
+ }
740
+ .peer [data-position = 'top' ] ~ .peer-data-\[position\=top\]\:underline {
741
+ text-decoration-line : underline;
742
+ }
743
+ .peer\/foo [data-position = 'top' ] ~ .peer-data-\[position\=top\]\/foo\:underline {
744
+ text-decoration-line : underline;
745
+ }
746
+ ` )
747
+ } )
748
+ } )
749
+
682
750
it ( 'should support supports' , ( ) => {
683
751
let config = {
684
752
theme : {
0 commit comments