Socket
Book a DemoInstallSign in
Socket

postcss-merge-rules

Package Overview
Dependencies
Maintainers
5
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-merge-rules

Merge CSS rules with PostCSS.

Source
npmnpm
Version
4.0.0-nightly.2020.7.24
Version published
Weekly downloads
6.5M
-13.84%
Maintainers
5
Weekly downloads
 
Created
Source

postcss-merge-rules

Merge CSS rules with PostCSS.

Install

With npm do:

npm install postcss-merge-rules --save

Examples

This module will attempt to merge adjacent CSS rules:

By declarations

Input

a {
    color: blue;
    font-weight: bold
}

p {
    color: blue;
    font-weight: bold
}

Output

a,p {
    color: blue;
    font-weight: bold
}

By selectors

Input

a {
    color: blue
}

a {
    font-weight: bold
}

Output

a {
    color: blue;
    font-weight: bold
}

By partial declarations

Input

a {
    font-weight: bold
}

p {
    color: blue;
    font-weight: bold
}

Output

a,p {
    font-weight: bold
}

p {
    color: blue
}

Usage

See the PostCSS documentation for examples for your environment.

Contributors

See CONTRIBUTORS.md.

License

MIT © Ben Briggs

Keywords

css

FAQs

Package last updated on 24 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts