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
SCSS always expands comma selectors and single-line rules to multiple lines #3464
P.S. Could you try to report one thing per issue in the future? Makes things much easier to discuss. Thanks! :)
Sorry about that. I kinda got carried away when making the example in the playground 😄
Regarding single-line rules, that's consistent with how Prettier always prints if (foo) { something(); } multi-line.
Yes, but JS also has the if (foo) something(); syntax. CSS doesn’t have that, and it would be nice IMHO to inline a CSS block with one statement (i.e. img { background: red; margin: 2px; } gets transformed, while img { background: red; } doesn’t.
Activity
lydell commentedon Dec 12, 2017
Sorry, the decision has already been made to put every selector on its own line. See #2047, #1962, #2057, #2213.
Regarding single-line rules, that's consistent with how Prettier always prints
if (foo) { something(); }multi-line.P.S. Could you try to report one thing per issue in the future? Makes things much easier to discuss. Thanks! :)
j-f1 commentedon Dec 12, 2017
Sorry about that. I kinda got carried away when making the example in the playground 😄
Yes, but JS also has the
if (foo) something();syntax. CSS doesn’t have that, and it would be nice IMHO to inline a CSS block with one statement (i.e.img { background: red; margin: 2px; }gets transformed, whileimg { background: red; }doesn’t.j-f1 commentedon Dec 12, 2017
Would a PR be accepted for making single-declaration rules like
foo.bar { baz: 'quux'; }stay on one line be accepted?lydell commentedon Dec 13, 2017
@j-f1 I doubt that. Prettier tries to have as few options as possible. See #3038 for a CSS-option PR that went far but probably won't be merged.