AndreasBackx / StyleSorter

CSS and SCSS attribute type sorter for Sublime Text 3. THIS PROJECT HAS BEEN ABANDONED.
8 stars 3 forks source link

Support for scss `@include` statements with params #1

Closed seaburrows closed 9 years ago

seaburrows commented 9 years ago

Super excited to find StyleSorter this morning; sadly as soon as I tried it on a real project file it broke the source.

The issue is that if you pass a explicitly set parameter into a @mixin it will split the string.

So:

color: green;
@include mq(small) {
  color: red;
}

is fine but:

color: green;
@include mq($from:small) {
  color: red;
}

will result in:

@include mq($until
color: green;
small) {
  color: red;
}

Suspect you just need to add support for :s

Thanks for this awesome package!

AndreasBackx commented 9 years ago

Thanks for leaving feedback. I know what's wrong and it's an easy fix. Once it comes across a ':', it needs to check whether it's an attribute or part of a nesting. That part isn't very well written either. I need to remove it from the list where it determines it's an attribute.

AndreasBackx commented 9 years ago

A friend of me made a pull request (#2) since I don't have my computer with me.

AndreasBackx commented 9 years ago

Tested it on my computer and it is fixed.