Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix removing commas from function arguments in maps #14089

Merged
merged 15 commits into from Jan 6, 2023
7 changes: 7 additions & 0 deletions src/language-css/printer-postcss.js
Expand Up @@ -857,6 +857,13 @@ function genericPrint(path, options, print) {
}

if (isMapItemNode) {
// Nodes after the colon are considered to be the value part of a key-value pair
// $foo: map-fn(
// (
// "foo" : "bar #{inner-fn($baz)}"
// ^^^^^(node.groups[0]) ^(node.groups[1]) ^^^^^^^^^^^^^^^^^^^^^^^(isPartOfValue === true)
// )
// );
const isPartOfValue =
fisker marked this conversation as resolved.
Show resolved Hide resolved
node.groups?.[1]?.type === "value-colon" && i > 1;
if (
fisker marked this conversation as resolved.
Show resolved Hide resolved
Expand Down