-
Notifications
You must be signed in to change notification settings - Fork 458
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
Sort-order shortcuts #76
Comments
Agree. |
After some thinking, I think this is how this feature should be implemented. Defining groupsThere should be some groups defined by default in CSSComb.js, this would allow users to write really small and maintainable I'd say, it could be {
"positioning": [
"position",
"z-index",
"top",
"right",
"bottom",
"left"
],
"box-model": [
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
]
} etc. The important things:
While there would be a predefined groups, they would be a bit optionated, but they won't influence on anything unless you would use them explicitly. And people could (if they would want) assign anything they would like to this option. Using groups and values inside of themGroupings could be used in Moreover, such group would take all the properties that start with its name, so As the order in groups in not important, we should output all the properties got from the group in the order they were in the source (this is arguable, actually — should be use the order in the groups? This would be much easier than to mix the strict order with the loose one got from groups) This could sound a bit complicated, but the logic behind this is really easy. Expanding the
|
Hi All! I'm closing this because unless a PR is created it won't likely be addressed. |
There is one thing I don't like in messing with
sort-order
option. It's that I need to use the existing example ofsort-order
, 'cause it contains all the props and if I would write this option from scratch I would surely forget something etc.What I'd want is this option to be smart enought to understand such way of adding it:
This example should be treated as something like that:
There could be a lot of nuances, but the main rules could be:
width, max-width, min-width
or theposition
above, so when you use one of them in settings and other properties from that list are not listed in config, they should go where the one of them was defined."sort-order": "yandex"
, this way the build-in groupyandex
would be used etc.While this is not that trivial and would need to have some defaults embedded in csscomb.js, this would be really handy and would make creating and maintaining such sort lists really easy and straightforwad.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1519080-sort-order-shortcuts?utm_campaign=plugin&utm_content=tracker%2F214563&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F214563&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: