-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Moves to the AtRule from PostCSS v8
- Loading branch information
Peter Ramsing
committed
Nov 8, 2020
1 parent
12053aa
commit e682e55
Showing
2 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
module.exports = function lostAtRule(css, Settings) { | ||
css.walkAtRules('lost', function lostAtRuleFunction(Rule) { | ||
var rule = Rule; | ||
var settings = Settings; | ||
module.exports = function lostAtRule(rule, settings) { | ||
const breakoutPramams = rule.params.split(' '); | ||
|
||
rule.params = rule.params.split(' '); | ||
if (breakoutPramams[0] === 'gutter') { | ||
settings.gutter = breakoutPramams[1]; | ||
} | ||
if (breakoutPramams[0] === 'clearing') { | ||
settings.clearing = breakoutPramams[1]; | ||
} | ||
|
||
if (rule.params[0] === 'clearing') { | ||
settings.clearing = rule.params[1]; | ||
} | ||
if (rule.params[0] === 'gutter') { | ||
settings.gutter = rule.params[1]; | ||
} | ||
if (rule.params[0] === 'flexbox') { | ||
settings.flexbox = rule.params[1]; | ||
} | ||
if (rule.params[0] === 'rounder') { | ||
settings.rounder = rule.params[1]; | ||
} | ||
if (rule.params[0] === '--beta-direction') { | ||
settings.direction = rule.params[1]; | ||
} | ||
if (rule.params[0] === 'cycle') { | ||
if (rule.params[1] !== 'auto') { | ||
if (rule.params[1] === 'none' || rule.params[1] === '0') { | ||
settings.cycle = 0; | ||
} else { | ||
settings.cycle = rule.params[1]; | ||
} | ||
if (breakoutPramams[0] === 'flexbox') { | ||
settings.flexbox = breakoutPramams[1]; | ||
} | ||
if (breakoutPramams[0] === 'rounder') { | ||
settings.rounder = breakoutPramams[1]; | ||
} | ||
if (breakoutPramams[0] === '--beta-direction') { | ||
settings.direction = breakoutPramams[1]; | ||
} | ||
if (breakoutPramams[0] === 'cycle') { | ||
if (breakoutPramams[1] !== 'auto') { | ||
if (breakoutPramams[1] === 'none' || breakoutPramams[1] === '0') { | ||
settings.cycle = 0; | ||
} else { | ||
settings.cycle = 'auto'; | ||
settings.cycle = breakoutPramams[1]; | ||
} | ||
} else { | ||
settings.cycle = 'auto'; | ||
} | ||
rule.remove(); | ||
}); | ||
} | ||
rule.remove(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters