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 Multiline declaration should not be on the same line as the property #7039
Reacted by Georgii Dolzhykov, Simon Lydell, Alexander Akait, Roman Savaryn, Viktor Andersson, Yoan Malié, domske, David Sveningsson, Olof Fredriksson, Calum Smith and 5 more
Yes, please implement this behavior. Either break when overflow the line width or always. I would prefer always, because it's very clean (prettier) when all values are below each other. You can change it without any confusion.
Yes (like my example), but please consider breaking always by an option or line break detection before values start. Such behavior already exists in Prettier for other languages. I would prefer formatting multiline if more than one value.
I've recently hit this issue as well and I'm a bit surprised by the current behavior. I believe the best implementation would be to always add line-breaks when using multiple declarations since it adds clarity and makes it obvious multiple statements are present:
.my-class{transition:
background-color 250ms ease-in-out,
color 250ms ease-in-out,
opacity 250ms ease-in-out;}
Reacted by Yoan Malié, Olof Fredriksson, Rich Edmunds and Alex Rice
Only break when multiple values are assigned. Single values can be formatted like the current behavior in one line.
I just wonder why the tag status:needs discussion? What's not clear?
It's Prettier and not Uglier. That is a very clear case. But please explain to me.
What's the problem here?
Reacted by domske, Alex Rice and Gediminas Bivainis
Activity
whatisaphone commentedon May 1, 2020
Search keywords: newline comma multiple split lines
I often notice this with
transitiontoo.Current formatting:
Ideal formatting:
To avoid some of the confusion from the last issue, this should of course continue to respect
printWidthlike usual.80 characters wide:
81 characters wide:
domske commentedon Sep 4, 2020
Yes, please implement this behavior. Either break when overflow the line width or always. I would prefer always, because it's very clean (prettier) when all values are below each other. You can change it without any confusion.
Current behavior (BAD):
Wrong implementation (BAD):
Correct implementation (GOOD):
Always - If more than one value. (BEST):
Prettier could either accept an option if "always" or on line overflow. OR detect it automatically if a line break is inserted before the first value.
Current workaround (disable prettier / BAD):
alexander-akait commentedon Sep 4, 2020
Here good example how it should work #7039 (comment)
domske commentedon Sep 4, 2020
Yes (like my example), but please consider breaking always by an option or line break detection before values start. Such behavior already exists in Prettier for other languages. I would prefer formatting multiline if more than one value.
ext commentedon Sep 11, 2020
I've recently hit this issue as well and I'm a bit surprised by the current behavior. I believe the best implementation would be to always add line-breaks when using multiple declarations since it adds clarity and makes it obvious multiple statements are present:
y0nd0 commentedon Feb 11, 2021
Sereosly, why is this not already implemented in Prettier? Beacuase this is prettier.
Another demo:
Current Prettier output
Expected "prettier" output
Only break when multiple values are assigned. Single values can be formatted like the current behavior in one line.
I just wonder why the tag
status:needs discussion? What's not clear?It's Prettier and not Uglier. That is a very clear case. But please explain to me.
What's the problem here?
thorn0 commentedon Feb 15, 2021
Duplicate of #6024