Respect spacing for between expressions and parentheses in embedded CSS (#11800)

* Fix embedded css formatting

* Add changelog
This commit is contained in:
Sosuke Suzuki authored and GitHub committed 2021-11-12 23:17:29 +09:00
1 parent ffbd04ebe2
commit 8f7c2f77a4
5 files changed
+91 -7

No files matched your search

+9 -7
View File
@@ -75,6 +75,7 @@ const {
lastLineHasInlineComment,
isAtWordPlaceholderNode,
isConfigurationNode,
isParenGroupNode,
} = require("./utils.js");
const { locStart, locEnd } = require("./loc.js");
@@ -810,14 +811,15 @@ function genericPrint(path, options, print) {
}
if (
iNode.value === "with" &&
iNextNode &&
iNextNode.type === "value-paren_group" &&
iNextNode.open &&
iNextNode.open.value === "(" &&
iNextNode.close &&
iNextNode.close.value === ")"
isAtWordPlaceholderNode(iNode) &&
isParenGroupNode(iNextNode) &&
locEnd(iNode) === locStart(iNextNode.open)
) {
parts.push(softline);
continue;
}
if (iNode.value === "with" && isParenGroupNode(iNextNode)) {
parts.push(" ");
continue;
}