[Prettier Plugin] Multiline sorting (suggestion) #7562
Replies: 5 comments 1 reply
-
if you use other frameworks that support multi-line this looks like it already works to some degree, ie:
the indentation is a bit of extra effort but the sorting at least works. If everything auto indented that would be perfect. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, I tried out the plugin with my multiline formatting and while sometimes it works on individual lines, more often than not it's inconsistent and bumps some properties seemingly randomly across lines, which is understandable given the complexity, I would imagine. For my use case, at least, it's probably going to be more hassle than help right now, but I look forward to seeing further developments :) Extra bonus issue—when using conditional classes in React like this (I certainly wouldn't expect this to be easily parsable 😅
Then of course, the more complex the css, I might choose to break individual properties with, say, 4 different breakpoints onto their own line — difficult to make these kind of decisions automatically I would imagine. |
Beta Was this translation helpful? Give feedback.
-
We miss this feature very much. From the perspective of our team, multi-line For us, the ideal solution would be the following:
|
Beta Was this translation helpful? Give feedback.
-
hello please i need help, I can't seem to style it with Tailwind. i have thys problem Rebuilding... |
Beta Was this translation helpful? Give feedback.
-
I think multiline utility classes should also be able in other areas. For example, I have a Vue application where I use As you can see, default css values respect the multiline style ( see grid-template-areas ). Unfortunately this does not work for This would be a great improvement for readability! |
Beta Was this translation helpful? Give feedback.
-
Hi! Absolutely love TWCSS and am glad to see automatic class sorting is being tackled :)
I just wanted to mention that for my workflow, at least, I could not work with all classes on a single line — everything becomes much more readable when you separate related classes onto multiple lines, such as:
Of course this requires quite a bit of manual work from my part, which is ok for me given that it makes everything so much easier to read. I imagine implementing automatic sorting and indenting in this way would be quite a challenge but I just thought I'd throw it out there as a consideration and see if others work this way. It would be incredible if it could be automated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions