Merge longhand properties into shorthand with PostCSS.
JavaScript
Latest commit 829da15 Jan 13, 2017 @ben-eb 2.0.2
Permalink
Failed to load latest commit information.
src Don't merge borders if any of the values is 'initial' Jan 13, 2017
.editorconfig Initial commit. Aug 17, 2015
.gitignore Initial commit. Aug 17, 2015
.jshintrc Initial commit. Aug 17, 2015
.travis.yml Initial commit. Aug 17, 2015
CHANGELOG.md Update changelog. Jan 13, 2017
LICENSE-MIT Initial commit. Aug 17, 2015
README.md Initial commit. Aug 17, 2015
package.json 2.0.2 Jan 13, 2017

README.md

postcss-merge-longhand Build Status NPM version Dependency Status

Merge longhand properties into shorthand with PostCSS.

Install

With npm do:

npm install postcss-merge-longhand --save

Example

Merge longhand properties into shorthand; works with margin, padding & border. For more examples see the tests.

Input

h1 {
    margin-top: 10px;
    margin-right: 20px;
    margin-bottom: 10px;
    margin-left: 20px;
}

Output

h1 {
    margin: 10px 20px;
}

Usage

See the PostCSS documentation for examples for your environment.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs