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

Less :extend() unwanted space #7977

Closed
andreaswilli opened this issue Apr 7, 2020 · 2 comments · Fixed by #7984
Closed

Less :extend() unwanted space #7977

andreaswilli opened this issue Apr 7, 2020 · 2 comments · Fixed by #7984
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. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! type:bug Issues identifying ugly output, or a defect in the program

Comments

@andreaswilli
Copy link

Prettier 2.0.3
Playground link

--parser less

Input:

// works as expected
.class {
  &:extend(.some-class .some-other-class .some-very-loooooooooooooong-class all);
}

// formatting once again adds an unwanted space after colon
.class {
  &:extend(
    .some-class .some-other-class .some-very-loooooooooooooong-class all
  );
}

Output:

// works as expected
.class {
  &:extend(
    .some-class .some-other-class .some-very-loooooooooooooong-class all
  );
}

// formatting once again adds an unwanted space after colon
.class {
  &: extend(
    .some-class .some-other-class .some-very-loooooooooooooong-class all
  );
}

The additional space after the color causes this error: Unrecognised input in file styles.less similar to #1967.

Expected behavior:

// works as expected
.class {
  &:extend(
    .some-class .some-other-class .some-very-loooooooooooooong-class all
  );
}

// no additional space after colon
.class {
  &:extend(
    .some-class .some-other-class .some-very-loooooooooooooong-class all
  );
}
@alexander-akait alexander-akait added lang:less Issues affecting Less-specific syntax (not plain CSS) type:bug Issues identifying ugly output, or a defect in the program lang:css/scss/less Issues affecting CSS, Less or SCSS and removed lang:less Issues affecting Less-specific syntax (not plain CSS) labels Apr 7, 2020
@alexander-akait
Copy link
Member

/cc @thorn0 Looks regression again

@thorn0
Copy link
Member

thorn0 commented Apr 7, 2020

Yes, regression. Output of 1.19.1:

// works as expected
.class {
  &:extend(.some-class
      .some-other-class
      .some-very-loooooooooooooong-class
      all);
}

// formatting once again adds an unwanted space after colon
.class {
  &:extend(.some-class
      .some-other-class
      .some-very-loooooooooooooong-class
      all);
}

@thorn0 thorn0 added the priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! label Apr 7, 2020
@fisker fisker mentioned this issue Apr 8, 2020
4 tasks
@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 Jul 8, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2020
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. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants