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

Regression in 2.8.1: Commas are removed from fn args in Sass maps. #13984

Closed
jgerigmeyer opened this issue Dec 12, 2022 · 3 comments · Fixed by #14089
Closed

Regression in 2.8.1: Commas are removed from fn args in Sass maps. #13984

jgerigmeyer opened this issue Dec 12, 2022 · 3 comments · Fixed by #14089
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@jgerigmeyer
Copy link

Probably caused by #9184?
Possible related to #13580?

Prettier 2.8.1
Playground link

--parser scss

Input:

@each $name, $hue in $hues {
  $map: map.merge(
    $map,
    (
      '#{$prefix}-#{$name}': blend.set($base, $hue: $hue),
    )
  );
}

Output:

@each $name, $hue in $hues {
  $map: map.merge($map, ('#{$prefix}-#{$name}': blend.set($base $hue: $hue)));
}

Expected behavior:

Comma should not be removed from blend.set($base, $hue: $hue) call.

@alexander-akait
Copy link
Member

alexander-akait commented Dec 12, 2022

It was printed in one line, so why we should keep commas?

@jgerigmeyer
Copy link
Author

jgerigmeyer commented Dec 12, 2022

@alexander-akait Sass function keyword arguments require comma-separators.

This is valid:

blend.set($base, $hue: $hue)

But this is invalid:

blend.set($base $hue: $hue)

https://sass-lang.com/documentation/at-rules/mixin#keyword-arguments

@alexander-akait
Copy link
Member

I see, I am thinking about the last 👍

@alexander-akait alexander-akait added type:bug Issues identifying ugly output, or a defect in the program lang:css/scss/less Issues affecting CSS, Less or SCSS labels Dec 12, 2022
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Nov 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
2 participants