Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Sass and LESS specific stuff & minor config changes. #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

websanya
Copy link

I guess it would be cool to make possible to sort pre-processor specific rules: includes, mixins and extends. I've added an array into sort-order. This is kinda new feature, so maybe the version should be updated to 1.1.0, according to Semantic Versioning.

Almost everybody sort their CSS, or SCSS or whatever on purpose. That purpose would be style guide. One of the most popular ones is SMACSS, this book has a chapter about formatting code. I guess this kind of style guide would be appropriate so I changed sort-order a bit.

I've changed block-indent and rule-indent to fix an issue when you sort already indented Sass or LESS files, previous setup messed everything up.

As for stick-brace key, it's value would be 1, because it's like global convention to use such a style, isn't it?

Added sort-order for Sass & LESS specific stuff and updated some config
with more default values.
Based on [Formatiing code](http://smacss.com/book/formatting) chapter
from the SMACSS book.
According to semantic versioning (http://semver.org)
@i-akhmadullin
Copy link
Owner

That file is just default config straight from csscomb so it kinda doesn't make sense to edit it. I think bigger problem is that at this moment plugin is hardcoded to exclusively use only this config file.

One way to fix this problem is to comb file not just selected text so csscomb can search for config recursively. So you just add custom .csscomb.json to project folder and csscomb will sort how you want.
This way feels much cleaner to me.

Another way is to add search in brackets for .csscomb.json and pass it instead of default config. But this will be effectively the same code as in csscomb and it much more error-prone.

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