@@ -738,12 +738,25 @@ test('group-[...]', () => {
738
738
739
739
test ( 'group-*' , ( ) => {
740
740
expect (
741
- run ( [
742
- 'group-hover:flex' ,
743
- 'group-focus:flex' ,
744
- 'group-hover:group-focus:flex' ,
745
- 'group-focus:group-hover:flex' ,
746
- ] ) ,
741
+ compileCss (
742
+ css `
743
+ @variant hocus {
744
+ & : hover ,
745
+ & : focus {
746
+ @slot ;
747
+ }
748
+ }
749
+ @tailwind utilities;
750
+ ` ,
751
+ [
752
+ 'group-hover:flex' ,
753
+ 'group-focus:flex' ,
754
+ 'group-hocus:flex' ,
755
+
756
+ 'group-hover:group-focus:flex' ,
757
+ 'group-focus:group-hover:flex' ,
758
+ ] ,
759
+ ) ,
747
760
) . toMatchInlineSnapshot ( `
748
761
".group-hover\\:flex:is(:where(.group):hover *) {
749
762
display: flex;
@@ -759,6 +772,10 @@ test('group-*', () => {
759
772
760
773
.group-hover\\:group-focus\\:flex:is(:where(.group):hover *):is(:where(.group):focus *) {
761
774
display: flex;
775
+ }
776
+
777
+ .group-hocus\\:flex:is(:is(:where(.group):hover, :where(.group):focus) *) {
778
+ display: flex;
762
779
}"
763
780
` )
764
781
@@ -816,12 +833,24 @@ test('peer-[...]', () => {
816
833
817
834
test ( 'peer-*' , ( ) => {
818
835
expect (
819
- run ( [
820
- 'peer-hover:flex' ,
821
- 'peer-focus:flex' ,
822
- 'peer-hover:peer-focus:flex' ,
823
- 'peer-focus:peer-hover:flex' ,
824
- ] ) ,
836
+ compileCss (
837
+ css `
838
+ @variant hocus {
839
+ & : hover ,
840
+ & : focus {
841
+ @slot ;
842
+ }
843
+ }
844
+ @tailwind utilities;
845
+ ` ,
846
+ [
847
+ 'peer-hover:flex' ,
848
+ 'peer-focus:flex' ,
849
+ 'peer-hocus:flex' ,
850
+ 'peer-hover:peer-focus:flex' ,
851
+ 'peer-focus:peer-hover:flex' ,
852
+ ] ,
853
+ ) ,
825
854
) . toMatchInlineSnapshot ( `
826
855
".peer-hover\\:flex:is(:where(.peer):hover ~ *) {
827
856
display: flex;
@@ -837,6 +866,10 @@ test('peer-*', () => {
837
866
838
867
.peer-hover\\:peer-focus\\:flex:is(:where(.peer):hover ~ *):is(:where(.peer):focus ~ *) {
839
868
display: flex;
869
+ }
870
+
871
+ .peer-hocus\\:flex:is(:is(:where(.peer):hover, :where(.peer):focus) ~ *) {
872
+ display: flex;
840
873
}"
841
874
` )
842
875
@@ -1502,26 +1535,54 @@ test('supports', () => {
1502
1535
1503
1536
test ( 'not' , ( ) => {
1504
1537
expect (
1505
- run ( [
1506
- 'not-[:checked]:flex' ,
1507
-
1508
- 'group-not-[:checked]:flex' ,
1509
- 'group-not-[:checked]/parent-name:flex' ,
1510
- 'group-not-checked:flex' ,
1511
-
1512
- 'peer-not-[:checked]:flex' ,
1513
- 'peer-not-[:checked]/parent-name:flex' ,
1514
- 'peer-not-checked:flex' ,
1515
- ] ) ,
1538
+ compileCss (
1539
+ css `
1540
+ @variant hocus {
1541
+ & : hover ,
1542
+ & : focus {
1543
+ @slot ;
1544
+ }
1545
+ }
1546
+ @tailwind utilities;
1547
+ ` ,
1548
+ [
1549
+ 'not-[:checked]:flex' ,
1550
+ 'not-hocus:flex' ,
1551
+
1552
+ 'group-not-[:checked]:flex' ,
1553
+ 'group-not-[:checked]/parent-name:flex' ,
1554
+ 'group-not-checked:flex' ,
1555
+ 'group-not-hocus:flex' ,
1556
+ 'group-not-hocus/parent-name:flex' ,
1557
+
1558
+ 'peer-not-[:checked]:flex' ,
1559
+ 'peer-not-[:checked]/sibling-name:flex' ,
1560
+ 'peer-not-checked:flex' ,
1561
+ 'peer-not-hocus:flex' ,
1562
+ 'peer-not-hocus/sibling-name:flex' ,
1563
+ ] ,
1564
+ ) ,
1516
1565
) . toMatchInlineSnapshot ( `
1517
- ".not-\\[\\:checked\\]\\:flex:not(:checked) {
1566
+ ".not-hocus\\:flex:not(:hover, :focus) {
1567
+ display: flex;
1568
+ }
1569
+
1570
+ .not-\\[\\:checked\\]\\:flex:not(:checked) {
1518
1571
display: flex;
1519
1572
}
1520
1573
1521
1574
.group-not-checked\\:flex:is(:where(.group):not(:checked) *) {
1522
1575
display: flex;
1523
1576
}
1524
1577
1578
+ .group-not-hocus\\:flex:is(:where(.group):not(:hover, :focus) *) {
1579
+ display: flex;
1580
+ }
1581
+
1582
+ .group-not-hocus\\/parent-name\\:flex:is(:where(.group\\/parent-name):not(:hover, :focus) *) {
1583
+ display: flex;
1584
+ }
1585
+
1525
1586
.group-not-\\[\\:checked\\]\\:flex:is(:where(.group):not(:checked) *) {
1526
1587
display: flex;
1527
1588
}
@@ -1534,11 +1595,19 @@ test('not', () => {
1534
1595
display: flex;
1535
1596
}
1536
1597
1598
+ .peer-not-hocus\\:flex:is(:where(.peer):not(:hover, :focus) ~ *) {
1599
+ display: flex;
1600
+ }
1601
+
1602
+ .peer-not-hocus\\/sibling-name\\:flex:is(:where(.peer\\/sibling-name):not(:hover, :focus) ~ *) {
1603
+ display: flex;
1604
+ }
1605
+
1537
1606
.peer-not-\\[\\:checked\\]\\:flex:is(:where(.peer):not(:checked) ~ *) {
1538
1607
display: flex;
1539
1608
}
1540
1609
1541
- .peer-not-\\[\\:checked\\]\\/parent -name\\:flex:is(:where(.peer\\/parent -name):not(:checked) ~ *) {
1610
+ .peer-not-\\[\\:checked\\]\\/sibling -name\\:flex:is(:where(.peer\\/sibling -name):not(:checked) ~ *) {
1542
1611
display: flex;
1543
1612
}"
1544
1613
` )
@@ -1556,22 +1625,46 @@ test('not', () => {
1556
1625
1557
1626
test ( 'has' , ( ) => {
1558
1627
expect (
1559
- run ( [
1560
- 'has-[:checked]:flex' ,
1561
-
1562
- 'group-has-[:checked]:flex' ,
1563
- 'group-has-[:checked]/parent-name:flex' ,
1564
- 'group-has-checked:flex' ,
1565
-
1566
- 'peer-has-[:checked]:flex' ,
1567
- 'peer-has-[:checked]/sibling-name:flex' ,
1568
- 'peer-has-checked:flex' ,
1569
- ] ) ,
1628
+ compileCss (
1629
+ css `
1630
+ @variant hocus {
1631
+ & : hover ,
1632
+ & : focus {
1633
+ @slot ;
1634
+ }
1635
+ }
1636
+ @tailwind utilities;
1637
+ ` ,
1638
+ [
1639
+ 'has-[:checked]:flex' ,
1640
+ 'has-hocus:flex' ,
1641
+
1642
+ 'group-has-[:checked]:flex' ,
1643
+ 'group-has-[:checked]/parent-name:flex' ,
1644
+ 'group-has-checked:flex' ,
1645
+ 'group-has-hocus:flex' ,
1646
+ 'group-has-hocus/parent-name:flex' ,
1647
+
1648
+ 'peer-has-[:checked]:flex' ,
1649
+ 'peer-has-[:checked]/sibling-name:flex' ,
1650
+ 'peer-has-checked:flex' ,
1651
+ 'peer-has-hocus:flex' ,
1652
+ 'peer-has-hocus/sibling-name:flex' ,
1653
+ ] ,
1654
+ ) ,
1570
1655
) . toMatchInlineSnapshot ( `
1571
1656
".group-has-checked\\:flex:is(:where(.group):has(:checked) *) {
1572
1657
display: flex;
1573
1658
}
1574
1659
1660
+ .group-has-hocus\\:flex:is(:where(.group):has(:hover, :focus) *) {
1661
+ display: flex;
1662
+ }
1663
+
1664
+ .group-has-hocus\\/parent-name\\:flex:is(:where(.group\\/parent-name):has(:hover, :focus) *) {
1665
+ display: flex;
1666
+ }
1667
+
1575
1668
.group-has-\\[\\:checked\\]\\:flex:is(:where(.group):has(:checked) *) {
1576
1669
display: flex;
1577
1670
}
@@ -1584,6 +1677,14 @@ test('has', () => {
1584
1677
display: flex;
1585
1678
}
1586
1679
1680
+ .peer-has-hocus\\:flex:is(:where(.peer):has(:hover, :focus) ~ *) {
1681
+ display: flex;
1682
+ }
1683
+
1684
+ .peer-has-hocus\\/sibling-name\\:flex:is(:where(.peer\\/sibling-name):has(:hover, :focus) ~ *) {
1685
+ display: flex;
1686
+ }
1687
+
1587
1688
.peer-has-\\[\\:checked\\]\\:flex:is(:where(.peer):has(:checked) ~ *) {
1588
1689
display: flex;
1589
1690
}
@@ -1592,6 +1693,10 @@ test('has', () => {
1592
1693
display: flex;
1593
1694
}
1594
1695
1696
+ .has-hocus\\:flex:has(:hover, :focus) {
1697
+ display: flex;
1698
+ }
1699
+
1595
1700
.has-\\[\\:checked\\]\\:flex:has(:checked) {
1596
1701
display: flex;
1597
1702
}"
0 commit comments