Support keeping fallback values
A new option removeDuplicatedValues has been added. (#534 thanks @MoltenCoffee)
In order to limit this to only combining properties when the values are equal, set the removeDuplicatedValues option to true instead. This could clean up duplicated properties, but allow for conscious duplicates such as fallbacks for custom properties.
const postcss = require('postcss');
const combineSelectors = require('postcss-combine-duplicated-selectors');
postcss([combineSelectors({removeDuplicatedValues: true})]);This will transform the following css
.a {
height: 10px;
}
.a {
width: 20px;
background: var(--custom-color);
background: rgba(255, 165, 0, 0.5);
}into
.a {
height: 10px;
width: 20px;
background: var(--custom-color);
background: rgba(255, 165, 0, 0.5);
}