diff --git a/src/options/sort-order.js b/src/options/sort-order.js index 27a2198a..482e0259 100644 --- a/src/options/sort-order.js +++ b/src/options/sort-order.js @@ -391,14 +391,19 @@ module.exports = { if (a[2] !== b[2]) { // If unprefixed parts are different (i.e. `border` and // `color`), compare them: - return a[2] <= b[2] ? -1 : 1; - } else { - // If unprefixed parts are identical (i.e. `border` in - // `-moz-border` and `-o-border`), compare prefixes. - // They should go in the same order they are set - // in `prefixes` array. - return prefixes.indexOf(a[1]) <= prefixes.indexOf(b[1]) ? -1 : 1; + return a[2] < b[2] ? -1 : 1; + } + + // If unprefixed parts are identical (i.e. `border` in + // `-moz-border` and `-o-border`), compare prefixes. + // They should be untouched if they are equal: + if (prefixes.indexOf(a[1]) === prefixes.indexOf(b[1])) { + return 0; } + + // They should go in the same order they are set + // in `prefixes` array. + return prefixes.indexOf(a[1]) < prefixes.indexOf(b[1]) ? -1 : 1; }, _sortNodes(nodes) {