A PostCSS plugin that allows for a comma-separated shorthand for properties that share the same value.
npm install --save-dev postcss-shared-values
or
yarn add -D postcss-shared-values
.foo {
height, width: 100px;
}
.foo {
height: 100px;
width: 100px;
}
An example is available in this repository. Use npm run example
or yarn example
to try it out.
Maybe, maybe not. This plugin encourages an invalid CSS syntax, which may be confusing to some users. However, it also encourages the user to explicitly group properties that are meant to share the same value, which may be helpful from a code maintenance standpoint. It's also a convenient shorthand.