@@ -767,18 +767,28 @@ it('should support supports', () => {
767
767
<div class= "supports-[display:grid]:grid" > </ div>
768
768
<!- - Value with spaces, needs to be normalized -- >
769
769
<div class= "supports-[transform-origin:5%_5%]:underline" > </ div>
770
- <!- - Selecto rs (raw) - - >
771
- <div class= "supports-[selector(A_>_B)]:underline" > </ div>
772
770
<!- - 'not' check (raw) - - >
773
771
<div class= "supports-[not(foo:bar)]:underline" > </ div>
774
772
<!- - 'or' check (raw) - - >
775
773
<div class= "supports-[(foo:bar)or(bar:baz)]:underline" > </ div>
776
774
<!- - 'and' check (raw) - - >
777
775
<div class= "supports-[(foo:bar)and(bar:baz)]:underline" > </ div>
776
+ <!- - 'and' check with spaces (raw) - - >
777
+ <div class= "supports-[(foo:bar)_and_(bar:baz)]:grid" > </ div>
778
+ <!- - 'and' + 'or' check (raw) - - >
779
+ <div class= "supports-[(foo:bar)_and_(bar:baz)_or(baz:qux)]:grid" > </ div>
778
780
<!- - No value give for the property, defaulting to prop : var(- - tw) - - >
779
781
<div class= "supports-[container-type]:underline" > </ div>
780
782
<!- - Named suppor ts usage - - >
781
783
<div class= "supports-grid:underline" > </ div>
784
+ <!- - Custo m properties - - >
785
+ <div class= "supports-[--test]:flex" > </ div>
786
+ <!- - Function syntax: selector (raw) - - >
787
+ <div class= "supports-[selector(A_>_B)]:underline" > </ div>
788
+ <!- - Function syntax: font- for mat (raw) - - >
789
+ <div class= "supports-[font-format(opentype)]:grid" > </ div>
790
+ <!- - Function syntax: font- tech (raw) - - >
791
+ <div class= "supports-[font-tech(color-COLRv1)]:flex" > </ div>
782
792
</ div>
783
793
` ,
784
794
} ,
@@ -791,45 +801,73 @@ it('should support supports', () => {
791
801
`
792
802
793
803
return run ( input , config ) . then ( ( result ) => {
794
- expect ( result . css ) . toMatchFormattedCss ( css `
795
- @supports (display : grid) {
796
- .supports-grid\:underline {
797
- text-decoration-line : underline;
798
- }
799
- .supports-\[display\:grid\]\:grid {
800
- display : grid;
801
- }
804
+ expect ( result . css ) . toMatchInlineSnapshot ( `
805
+ "@supports (display: grid) {
806
+ .supports-grid\\:underline {
807
+ text-decoration-line: underline
808
+ }
802
809
}
803
- @supports (foo : bar) and ( bar : baz ) {
804
- .supports-\[\(foo\:bar\)and\(bar\:baz\)\]\:underline {
805
- text-decoration-line : underline;
806
- }
810
+ @supports (--test: var(--tw) ) {
811
+ .supports-\\[--test\\]\\:flex {
812
+ display: flex
813
+ }
807
814
}
808
- @supports (foo : bar) or (bar : baz) {
809
- .supports-\[\(foo\:bar\)or\(bar\:baz\)\]\:underline {
810
- text-decoration-line : underline;
811
- }
815
+ @supports font-tech(color-COLRv1) {
816
+ .supports-\\[font-tech\\(color-COLRv1\\)\\]\\:flex {
817
+ display: flex
818
+ }
819
+ }
820
+ @supports (foo:bar) and (bar:baz) {
821
+ .supports-\\[\\(foo\\:bar\\)_and_\\(bar\\:baz\\)\\]\\:grid {
822
+ display: grid
823
+ }
824
+ }
825
+ @supports (foo:bar) and (bar:baz) or (baz:qux) {
826
+ .supports-\\[\\(foo\\:bar\\)_and_\\(bar\\:baz\\)_or\\(baz\\:qux\\)\\]\\:grid {
827
+ display: grid
828
+ }
829
+ }
830
+ @supports (display:grid) {
831
+ .supports-\\[display\\:grid\\]\\:grid {
832
+ display: grid
833
+ }
834
+ }
835
+ @supports font-format(opentype) {
836
+ .supports-\\[font-format\\(opentype\\)\\]\\:grid {
837
+ display: grid
838
+ }
839
+ }
840
+ @supports (foo:bar) and (bar:baz) {
841
+ .supports-\\[\\(foo\\:bar\\)and\\(bar\\:baz\\)\\]\\:underline {
842
+ text-decoration-line: underline
843
+ }
844
+ }
845
+ @supports (foo:bar) or (bar:baz) {
846
+ .supports-\\[\\(foo\\:bar\\)or\\(bar\\:baz\\)\\]\\:underline {
847
+ text-decoration-line: underline
848
+ }
812
849
}
813
850
@supports (container-type: var(--tw)) {
814
- .supports-\[container-type\] \:underline {
815
- text-decoration-line : underline;
816
- }
851
+ .supports-\\ [container-type\\]\ \:underline {
852
+ text-decoration-line: underline
853
+ }
817
854
}
818
- @supports not (foo : bar) {
819
- .supports-\[not\(foo\:bar\)\] \:underline {
820
- text-decoration-line : underline;
821
- }
855
+ @supports not (foo:bar) {
856
+ .supports-\\ [not\\ (foo\\ :bar\\)\\]\ \:underline {
857
+ text-decoration-line: underline
858
+ }
822
859
}
823
860
@supports selector(A > B) {
824
- .supports-\[selector\(A_\>_B\)\] \:underline {
825
- text-decoration-line : underline;
826
- }
861
+ .supports-\\ [selector\\ (A_\\ >_B\\)\\]\ \:underline {
862
+ text-decoration-line: underline
863
+ }
827
864
}
828
- @supports (transform-origin : 5% 5% ) {
829
- .supports-\[transform-origin\:5\%_5\%\] \:underline {
830
- text-decoration-line : underline;
831
- }
865
+ @supports (transform-origin:5% 5%) {
866
+ .supports-\\ [transform-origin\\ :5\\ %_5\\%\\]\ \:underline {
867
+ text-decoration-line: underline
868
+ }
832
869
}
870
+ "
833
871
` )
834
872
} )
835
873
} )
0 commit comments