matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Support for stylelint's max-line-length #82

Open silverwind opened 8 years ago

silverwind commented 8 years ago

For wrapping long list of selectors, support for max-line-length would be great to have. This can get a bit tricky to get right when it comes to comments and url, which should probably be left out from wrapping.

Example input

.aaaaaaaaaaaaaaaaaaaaaaaaaaa, .bbbbbbbbbbbbbbbbbbbbbbbbbbb, .ccccccccccccccccccccccccccc, .ddddddddddddddddddddddddddd {
  color: blue;
}

Example output, wrapped at 80:

.aaaaaaaaaaaaaaaaaaaaaaaaaaa, .bbbbbbbbbbbbbbbbbbbbbbbbbbb,
.ccccccccccccccccccccccccccc, .ddddddddddddddddddddddddddd {
  color: blue;
}
matype commented 8 years ago

It seems nice! But, it is only for selectors. Now, I have no idea to handle comments and url as you said. Thanks for your idea :)

Mottie commented 8 years ago

Maybe the code used by perfectionist would help?