Skip to content

Conversation

@scalder27
Copy link

It would be cool keep indentation between ">child" classes. Much more readable.
Also, I`ve had in mind a csscomb.js issue about this (csscomb/csscomb.js#441).

@hudochenkov
Copy link
Owner

Thank you for your PR, but I can't accept it yet. This is breaking change. It will break backward compatibility. And I personally don't like this empty lines, but it may be useful for some developers.

You may add a new option empty-lines-between-children-rules to config for adding empty lines between children. The config will look like this:

{
    "sort-order": [
        [
            "display",
            "visibility",
            "..."
        ],
        [ ">child" ]
    ],
    "empty-lines-between-children-rules": 1
}

This will add 1 empty line between child rules. The default value should be set to 0, so nothing breaks for users when they update to the new plugin version.

P. S. CSSComb's issue you mention is already solved by this plugin :)

@scalder27
Copy link
Author

Thank you for responding so quickly! Your arguments sound resonable, I`ll add option.
P.S. Indeed! My bad =(

@scalder27
Copy link
Author

@hudochenkov, is it better now?

test/test.js Outdated
});

test('Should insert empty lines between children classes in accordance with option \'empty-lines-between-children-rules\'', t => {
return run(t, 'prefixed', {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be return run(t, 'lines-between-children.expected', {, because second argument for run() is file name without extension. Also rename .scss to .css. You will see if tests working if file lines-between-children.actual.css will be created after tests run. This file will show what is actual output of the current test.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facepalm on my face! Copy paste is evil!
Fixed it

@hudochenkov
Copy link
Owner

@scalder27 this is very cool! Please fix issues I'm commented about. Can you also add documentation for new option?

@scalder27
Copy link
Author

@hudochenkov issues was fixed, documentation was added =)
Thanks for the cool review! It was good!

@hudochenkov
Copy link
Owner

@scalder27 this is amazing! Can you make the last two changes, please? :)

  • Add space after if: if(if (.
  • Squash all commits to one.

It would be cool keep indentation between ">child" classes. Much more readable.
Also, I`ve had in mind a csscomb.js issue about this (csscomb/csscomb.js#441).
@scalder27
Copy link
Author

@hudochenkov amazingly Ive managed to do the last two changes =) And, please, pay attention: Ive added eslint rule and --fix param to npm lint script, is it ok? I just wasn`t in a fixing if-stuffs manually mood...

@hudochenkov
Copy link
Owner

You did a great work, @scalder27! Thank you!

hudochenkov added a commit that referenced this pull request Feb 6, 2016
Add space between subclasses, children styles
@hudochenkov hudochenkov merged commit 0f4c026 into hudochenkov:master Feb 6, 2016
@scalder27
Copy link
Author

Thank you, @hudochenkov, you did a really great work with postcss-sorting! When csscomb.js let us down, your project saved us from an unavoidable stylesheets entropy =)
It was a pleasure work with you!

@hudochenkov
Copy link
Owner

@scalder27 I've released the new version :)

@scalder27
Copy link
Author

@hudochenkov, its unbelievably awesome! My first github contribution! To the instrument that I and my team using daily. Coool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants