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

CSS/SCSS format.spaceAroundSelectorSeparator not working correctly #199462

Closed
webdevnerdstuff opened this issue Nov 28, 2023 · 1 comment
Closed
Assignees

Comments

@webdevnerdstuff
Copy link

webdevnerdstuff commented Nov 28, 2023

Does this issue occur when all extensions are disabled?: Yes

Both settings are included:

{
  "css.format.spaceAroundSelectorSeparator": true,
  "scss.format.spaceAroundSelectorSeparator": true,
  "[css]": {
    "editor.defaultFormatter": "vscode.css-language-features",
    "editor.formatOnSave": true
  },
  "[scss]": {
    "editor.defaultFormatter": "vscode.css-language-features",
    "editor.formatOnSave": true,
  },
}

I'm not 100% positive that spaceAroundSelectorSeparator should add this space, but that was the only setting I could find that deals with spacing and these characters. Either way the formatter should not be removing this space. I have also tried with using Prettier as the formatter to see if it did it there as well, and it does not remove the space.

  • VS Code Version: 1.84.2 (Universal)
  • OS Version: Mac 13.5.2 (22G91)

Steps to Reproduce:

  1. Use an operator in an @if statement
  2. Format the code
  3. Notice the right side of the operator space is removed

Ex.

@for $i from 1 through $positions {
  &.pos#{$i} {
    left: $i * if($i !=$positions, 10%, 15%);
  }
}

@if $positions ==10 {
  &.pos11 {
    left: 100%;
  }
}
@aeschli
Copy link
Contributor

aeschli commented Nov 29, 2023

We internally use the jsbeautifier for SCSS as well. I created beautifier/js-beautify#2223

@aeschli aeschli closed this as completed Nov 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants