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] Don’t combine multiple selectors onto same line #2057

Closed
keithjgrant opened this issue Jun 8, 2017 · 2 comments
Closed

[CSS] Don’t combine multiple selectors onto same line #2057

keithjgrant opened this issue Jun 8, 2017 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@keithjgrant
Copy link

keithjgrant commented Jun 8, 2017

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.

@keithjgrant
Copy link
Author

BTW, thanks for the CSS support. This is awesome! 😃

@vjeux
Copy link
Contributor

vjeux commented 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.

@vjeux vjeux closed this as completed Jun 8, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants