File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
packages/postcss-if-function/test Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,40 @@ describe('postcss-if-function plugin', () => {
94
94
await run ( input , expected ) ;
95
95
} ) ;
96
96
97
+ it ( 'should handle multiple concatenated if() functions' , async ( ) => {
98
+ const input = `
99
+ .responsive {
100
+ padding: if(
101
+ media(width >= 1200px): 40px; media(width >= 768px): 30px;
102
+ media(width >= 480px): 20px; else: 15px
103
+ );
104
+ }` ;
105
+
106
+ const expected = `.responsive {
107
+ padding: 15px;
108
+ }
109
+
110
+ @media (width >= 1200px) {
111
+ .responsive {
112
+ padding: 40px;
113
+ }
114
+ }
115
+
116
+ @media (width >= 768px) {
117
+ .responsive {
118
+ padding: 30px;
119
+ }
120
+ }
121
+
122
+ @media (width >= 480px) {
123
+ .responsive {
124
+ padding: 20px;
125
+ }
126
+ }` ;
127
+
128
+ await run ( input , expected ) ;
129
+ } ) ;
130
+
97
131
it ( 'should handle CSS that does not contain if() functions' , async ( ) => {
98
132
const input = `
99
133
.normal {
You can’t perform that action at this time.
0 commit comments