'Is there a way to stop visual studio code from autoformatting multiple selectors?

(First post here so apologies if i'm doing something wrong)

Visual studio code autoformatter keeps formatting multiple selector styling from this

.header-example, .header2-example {
  font-size: larger;
}

into this

.header-example,
.header2-example {
  font-size: larger;
}

and it's driving me crazy. I could turn off the autoformatter on save but it's pretty useful and so far that's the only inconvenience that i"m having...

Thanks!



Solution 1:[1]

Press windows+R , and type %appdata% in the dialog box, then goto \Code\User\settings.json, here past the following :

{"brace_style": "collapse,preserve-inline"}

Solution 2:[2]

If someone still needs it..

Go to "Settings->Extensions->CSS Language Features -> CSS" And deselect "Format: Newline Between Selectors"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ssomename
Solution 2 viliperi