fix(css): space after `if` in `else` at rule (#3921)

master
Evilebot Tnawi 2018-02-07 19:53:28 +03:00 committed by GitHub
parent 517db8f5db
commit bc027bd661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -347,7 +347,7 @@ function parseNestedCSS(node) {
// Remove unnecessary spaces in SCSS variable arguments
node.params = node.params.replace(/\s+\.\.\./, "...");
// Remove unnecessary spaces before SCSS control, mixin and function directives
node.params = node.params.replace(/^(\S+)\s+\(/, "$1(");
node.params = node.params.replace(/^(?!if)(\S+)\s+\(/, "$1(");
node.value = parseValue(node.params);
delete node.params;

View File

@ -2005,6 +2005,7 @@ p {
@if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {}
@if (str-slice($item, 0, 1) == ":") {}
@if (str-slice($item, 0, 3) == " : ") {}
@if ($type == ocean) {} @else if ($type == matador) {} @else {}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@if $media == phonePortrait {
@ -2132,6 +2133,10 @@ p {
}
@if (str-slice($item, 0, 3) == " : ") {
}
@if ($type == ocean) {
} @else if ($type == matador) {
} @else {
}
}
`;

View File

@ -141,4 +141,5 @@ p {
@if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {}
@if (str-slice($item, 0, 1) == ":") {}
@if (str-slice($item, 0, 3) == " : ") {}
@if ($type == ocean) {} @else if ($type == matador) {} @else {}
}