|
1 | | -module.exports = function lostAtRule(css, Settings) { |
2 | | - css.walkAtRules('lost', function lostAtRuleFunction(Rule) { |
3 | | - var rule = Rule; |
4 | | - var settings = Settings; |
| 1 | +module.exports = function lostAtRule(rule, settings) { |
| 2 | + const breakoutPramams = rule.params.split(' '); |
5 | 3 |
|
6 | | - rule.params = rule.params.split(' '); |
| 4 | + if (breakoutPramams[0] === 'gutter') { |
| 5 | + settings.gutter = breakoutPramams[1]; |
| 6 | + } |
| 7 | + if (breakoutPramams[0] === 'clearing') { |
| 8 | + settings.clearing = breakoutPramams[1]; |
| 9 | + } |
7 | 10 |
|
8 | | - if (rule.params[0] === 'clearing') { |
9 | | - settings.clearing = rule.params[1]; |
10 | | - } |
11 | | - if (rule.params[0] === 'gutter') { |
12 | | - settings.gutter = rule.params[1]; |
13 | | - } |
14 | | - if (rule.params[0] === 'flexbox') { |
15 | | - settings.flexbox = rule.params[1]; |
16 | | - } |
17 | | - if (rule.params[0] === 'rounder') { |
18 | | - settings.rounder = rule.params[1]; |
19 | | - } |
20 | | - if (rule.params[0] === '--beta-direction') { |
21 | | - settings.direction = rule.params[1]; |
22 | | - } |
23 | | - if (rule.params[0] === 'cycle') { |
24 | | - if (rule.params[1] !== 'auto') { |
25 | | - if (rule.params[1] === 'none' || rule.params[1] === '0') { |
26 | | - settings.cycle = 0; |
27 | | - } else { |
28 | | - settings.cycle = rule.params[1]; |
29 | | - } |
| 11 | + if (breakoutPramams[0] === 'flexbox') { |
| 12 | + settings.flexbox = breakoutPramams[1]; |
| 13 | + } |
| 14 | + if (breakoutPramams[0] === 'rounder') { |
| 15 | + settings.rounder = breakoutPramams[1]; |
| 16 | + } |
| 17 | + if (breakoutPramams[0] === '--beta-direction') { |
| 18 | + settings.direction = breakoutPramams[1]; |
| 19 | + } |
| 20 | + if (breakoutPramams[0] === 'cycle') { |
| 21 | + if (breakoutPramams[1] !== 'auto') { |
| 22 | + if (breakoutPramams[1] === 'none' || breakoutPramams[1] === '0') { |
| 23 | + settings.cycle = 0; |
30 | 24 | } else { |
31 | | - settings.cycle = 'auto'; |
| 25 | + settings.cycle = breakoutPramams[1]; |
32 | 26 | } |
| 27 | + } else { |
| 28 | + settings.cycle = 'auto'; |
33 | 29 | } |
34 | | - rule.remove(); |
35 | | - }); |
| 30 | + } |
| 31 | + rule.remove(); |
36 | 32 | }; |
0 commit comments