fix(css): ignore `media` params with scss interpolation (#3801)

master
Evilebot Tnawi 2018-01-24 12:31:30 +03:00 committed by GitHub
parent d3004b51ea
commit 7797c93489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View File

@ -211,6 +211,14 @@ function parseNestedCSS(node) {
value: node.params
};
} else {
if (node.params.includes("#{")) {
// Workaround for media at rule with scss interpolation
return {
type: "media-unknown",
value: node.params
};
}
node.params = parseMediaQuery(node.params);
}
}

View File

@ -317,6 +317,13 @@ p {
width: AnotherMyCalculationFunction(10px, 5px);
border: border(25px, 35px);
}
$sm-only: '(min-width: 768px) and (max-width: 991px)';
$lg-and-up: '(min-width: 1200px)';
@media screen and #{$sm-only, $lg-and-up} {
color: #000;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@media #{$g-breakpoint-tiny} {
}
@ -648,4 +655,11 @@ p {
border: border(25px, 35px);
}
$sm-only: "(min-width: 768px) and (max-width: 991px)";
$lg-and-up: "(min-width: 1200px)";
@media screen and #{$sm-only, $lg-and-up} {
color: #000;
}
`;

View File

@ -307,3 +307,10 @@ p {
width: AnotherMyCalculationFunction(10px, 5px);
border: border(25px, 35px);
}
$sm-only: '(min-width: 768px) and (max-width: 991px)';
$lg-and-up: '(min-width: 1200px)';
@media screen and #{$sm-only, $lg-and-up} {
color: #000;
}