csscomb.js
csscomb.js copied to clipboard
Sort order fallback: Add `yandex`, `zen` and `csscomb`
From discussion with @matmuchrapna:
Allow using sort orders from predefined configs as sort-order-fallback
option.
For example:
{
"always-semicolon": true,
"sort-order": ["color", "..."],
"sort-order-fallback": "yandex"
}
// Before
a {
left: 0;
color: 0;
top: 0;
}
// Before
a {
color: 0;
top: 0;
left: 0;
}
From issue's description it's not clear that I want not exact sort-order-fallback
, because it will not work without sort-order
, but I should not be required to define my own sort-order
if I want to use sort-order
from predefined presets.
@matmuchrapna, you can just define in config: "sort-order": ["..."]
ok, but will look like hack, wouldn't it?
:+1:
How about just adding a preset
option to get all values from a predefined configuration and then extend it with the user defined values. Very similar to jscs presets
example:
{
"preset": "zen",
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"quotes": "double",
"sort-order-fallback": "abc",
}
This not only solves sort order fallback but allows end user to leverage all existing configs with just a few tweaks to match their taste.
preset
+1