You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CSS] Don’t combine multiple selectors onto same line #2057
Right now, Prettier merges multiple selectors into the same line if space allows:
.foo,
.bar,
.baz {}
becomes:
.foo, .bar, .baz {}
I don’t think this behavior jives with the way most people write CSS. It is both my preference and, I think, more common to always separate selectors onto their own lines, regardless of length. This helps when scanning a file visually for a particular selector, so .foo, .bar isn’t mis-read as .foo .bar.
Additional support for this reasoning: reading through the Bootstrap source, they keep selectors separate, regardless of length, in almost every instance. The Foundation framework also follows this practice for the most part, though it’s a little less consistent.
Activity
keithjgrant commentedon Jun 8, 2017
BTW, thanks for the CSS support. This is awesome! 😃
vjeux commentedon Jun 8, 2017
I just merged @yuchi's PR to fix this! #2047 In the next release of prettier it'll always print them line by line.