@@ -3,7 +3,7 @@ import { compile, middleware, prefixer, serialize, stringify } from 'stylis';
3
3
import stylisRtlPlugin from './stylis-rtl' ;
4
4
5
5
const stylis = ( css , extraPlugins = [ ] ) =>
6
- serialize ( compile ( css ) , middleware ( [ stylisRtlPlugin , ...extraPlugins , stringify ] ) ) ;
6
+ serialize ( compile ( css ) , middleware ( [ ...extraPlugins , stylisRtlPlugin , stringify ] ) ) ;
7
7
8
8
describe ( 'integration test with stylis' , ( ) => {
9
9
it ( 'flips simple rules' , ( ) => {
@@ -74,6 +74,23 @@ describe('integration test with stylis', () => {
74
74
) ;
75
75
} ) ;
76
76
77
+ it ( 'flips supports queries' , ( ) => {
78
+ expect (
79
+ stylis (
80
+ `@supports (display: flex) {
81
+ .a {
82
+ padding-left: 5px;
83
+ margin-right: 5px;
84
+ border-left: 1px solid red;
85
+ }
86
+ }
87
+ `
88
+ )
89
+ ) . toMatchInlineSnapshot (
90
+ `"@supports (display: flex){.a{padding-right:5px;margin-left:5px;border-right:1px solid red;}}"`
91
+ ) ;
92
+ } ) ;
93
+
77
94
it ( 'works in tandem with prefixer' , ( ) => {
78
95
expect (
79
96
stylis (
@@ -103,4 +120,17 @@ describe('integration test with stylis', () => {
103
120
` )
104
121
) . toMatchInlineSnapshot ( `".cls .nested{color:hotpink;}"` ) ;
105
122
} ) ;
123
+
124
+ it ( "works for nested rules" , ( ) => {
125
+ expect (
126
+ stylis ( `
127
+ .cls {
128
+ margin-right: 32px;
129
+ & .first-child {
130
+ margin-right: 32px;
131
+ }
132
+ }
133
+ ` )
134
+ ) . toMatchInlineSnapshot ( `".cls{margin-left:32px;}.cls .first-child{margin-left:32px;}"` ) ;
135
+ } ) ;
106
136
} ) ;
0 commit comments