fix(css): comments in selectors (#3909)

This commit is contained in:
Evilebot Tnawi authored and GitHub committed 2018-02-07 13:20:13 +03:00
1 parent 6b5765da36
commit 9e6bd15ade
10 files changed
+249 -64

No files matched your search

+5 -3
View File
@@ -65,9 +65,11 @@ function genericPrint(path, options, print) {
// with a colon, so keep the original case then.
const isDetachedRulesetDeclaration =
node.selector &&
typeof node.selector === "string" &&
node.selector.startsWith("@") &&
node.selector.endsWith(":");
node.selector.type !== "selector-root-invalid" &&
((typeof node.selector === "string" &&
/^@.+:.*$/.test(node.selector)) ||
(node.selector.value && /^@.+:.*$/.test(node.selector.value)));
return concat([
path.call(print, "selector"),
node.important ? " !important" : "",