Skip to content

A PostCSS plugin that allows for a comma-separated shorthand for properties that share the same value.

Notifications You must be signed in to change notification settings

zgreen/postcss-shared-values

Repository files navigation

PostCSS Shared Values

Travis build status

A PostCSS plugin that allows for a comma-separated shorthand for properties that share the same value.

Install

npm install --save-dev postcss-shared-values or yarn add -D postcss-shared-values

Usage examples

Input CSS:

.foo {
  height, width: 100px;
}

Output CSS:

.foo {
  height: 100px;
  width: 100px;
}

Try it out.

An example is available in this repository. Use npm run example or yarn example to try it out.

Is this a good idea?

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.

About

A PostCSS plugin that allows for a comma-separated shorthand for properties that share the same value.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published