Open keithjgrant opened 7 years ago
It's fantastic to see these issues broken out. It makes it so much more digestible :)
If the intent is to follow prettier's implementation, then it looks like your suggestions here are totally on track.
And if it is longer than one line, split it into multiple lines
Yep, that sounds like rule 1.
This second example happens to include nested functions. What happens if those get too long?
Rule two is apparently to break the outer group first, which looks like what you're doing in your last example.
Lastly, the position of the closing bracket in the following example looks great to me, and also in line with how prettier does it.
.foo {
background-image: linear-gradient(
to bottom,
hsla(200, 100%, 50%, 0.9) 10%,
);
color: white;
}
We should have a particular opinion on formatting of functions. Below is a starting point for discussion.
Short enough to fit on one line (i.e. declaration plus indentation level is within the line-length threshold):
And if it is longer than one line, split it into multiple lines:
This second example happens to include nested functions. What happens if those get too long? Here's a really over-the-top example: