|
143 | 143 | @function media-condition($conditions...) { |
144 | 144 | $compiled-list: (); |
145 | 145 | @for $i from 1 through length($conditions) { |
146 | | - $condition: unquote(quote(nth($conditions,$i))); |
147 | | - // Basic String Conditions |
148 | | - @if map-has-key($condition-map, $condition) { |
149 | | - $pre: map-get($condition-map,$condition); |
150 | | - @if(type-of($pre) == list) { |
151 | | - @for $ii from 1 through length($pre) { |
152 | | - $part: unquote(quote(nth($pre,$ii))); |
153 | | - $compiled-list: append( $compiled-list, $part, comma ); |
154 | | - } |
155 | | - } @else { |
156 | | - $compiled-list: append( $compiled-list, map-get( $condition-map,$condition ), comma ); |
157 | | - } |
| 146 | + $nth: nth($conditions,$i); |
| 147 | + @if(type-of($nth) == list) { |
| 148 | + $compiled-list: append($compiled-list, media-condition($nth), comma ); |
158 | 149 | } @else { |
159 | | - $operator: get-expression-operator($condition); |
160 | | - $value: get-expression-value($condition,$operator); |
161 | | - @if map-has-key($grid-breakpoints, $value) { |
162 | | - // Breakpoint Based Conditions |
163 | | - $compiled-list: append($compiled-list, get-breakpoint-string($value, $operator), comma); |
| 150 | + $condition: unquote(quote(nth($conditions,$i))); |
| 151 | + // Basic String Conditions |
| 152 | + @if map-has-key($condition-map, $condition) { |
| 153 | + $pre: map-get($condition-map,$condition); |
| 154 | + @if(type-of($pre) == list) { |
| 155 | + @for $ii from 1 through length($pre) { |
| 156 | + $part: unquote(quote(nth($pre,$ii))); |
| 157 | + $compiled-list: append( $compiled-list, $part, comma ); |
| 158 | + } |
| 159 | + } @else { |
| 160 | + $compiled-list: append( $compiled-list, map-get( $condition-map,$condition ), comma ); |
| 161 | + } |
164 | 162 | } @else { |
165 | | - // Width Based Condition |
166 | | - $compiled-list: append($compiled-list, get-width-string($operator,$value,$value), comma ); |
| 163 | + $operator: get-expression-operator($condition); |
| 164 | + $value: get-expression-value($condition,$operator); |
| 165 | + @if map-has-key($grid-breakpoints, $value) { |
| 166 | + // Breakpoint Based Conditions |
| 167 | + $compiled-list: append($compiled-list, get-breakpoint-string($value, $operator), comma); |
| 168 | + } @else { |
| 169 | + // Width Based Condition |
| 170 | + $compiled-list: append($compiled-list, get-width-string($operator,$value,$value), comma ); |
| 171 | + } |
167 | 172 | } |
168 | 173 | } |
169 | 174 | } |
|
0 commit comments