All Projects → leodido → postcss-clean

leodido / postcss-clean

Licence: MIT license
PostCss plugin to minify your CSS with clean-css

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to postcss-clean

postcss-inline-media
Media queries shortcut, built on PostCSS, example: font-size: 20px @1200 18px @480 16px;
Stars: ✭ 47 (+14.63%)
Mutual labels:  postcss, postcss-plugin
postcss
No description or website provided.
Stars: ✭ 59 (+43.9%)
Mutual labels:  postcss, postcss-plugin
postcss-styl
PostCSS parser plugin for converting Stylus syntax to PostCSS AST.
Stars: ✭ 15 (-63.41%)
Mutual labels:  postcss, postcss-plugin
postcss-center
PostCSS plugin to center elements.
Stars: ✭ 44 (+7.32%)
Mutual labels:  postcss, postcss-plugin
postcss-lazyimagecss
A PostCSS plugin that generates images's CSS width & height properties automatically.
Stars: ✭ 38 (-7.32%)
Mutual labels:  postcss, postcss-plugin
MinifyAll
A 𝗩𝗦𝗖𝗼𝗱𝗲 𝗺𝗶𝗻𝗶𝗳𝗶𝗲𝗿 for JS, JSON/C, CSS, and HTML, you will love its simplicity! 🌟 𝘾𝙤𝙢𝙥𝙧𝙚𝙨𝙨 and 𝙜𝙯𝙞𝙥 files and folders 📦 Reduce your bundle and file sizes with lightning speed ⚡
Stars: ✭ 54 (+31.71%)
Mutual labels:  minify, minification
postcss-rename
Replace class names based on a customizable renaming scheme.
Stars: ✭ 77 (+87.8%)
Mutual labels:  postcss, postcss-plugin
clean-css
Fast and efficient CSS optimizer for node.js and the Web
Stars: ✭ 4,048 (+9773.17%)
Mutual labels:  minification, clean-css
postcss-prefixwrap
A PostCSS plugin that is used to wrap css styles with a css selector to constrain their affect on parent elements in a page.
Stars: ✭ 54 (+31.71%)
Mutual labels:  postcss, postcss-plugin
postcss-purgecss
PostCSS plugin for purgecss
Stars: ✭ 92 (+124.39%)
Mutual labels:  postcss, postcss-plugin
postcss-input-style
PostCSS plugin that adds new pseudo-elements for easily styling the inner elements of inputs
Stars: ✭ 16 (-60.98%)
Mutual labels:  postcss, postcss-plugin
postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (-43.9%)
Mutual labels:  postcss, postcss-plugin
postcss-clearfix
PostCSS plugin that adds a 'fix' argument to the 'clear' property
Stars: ✭ 47 (+14.63%)
Mutual labels:  postcss, postcss-plugin
postcss-import-url
PostCSS plugin inlines remote files.
Stars: ✭ 47 (+14.63%)
Mutual labels:  postcss, postcss-plugin
postcss-trash-killer
It is a postcss plugin which wil be remove all unused css
Stars: ✭ 20 (-51.22%)
Mutual labels:  postcss, postcss-plugin
postcss-critical-css
PostCSS plugin to define and output critical CSS using custom atRules, and/or custom CSS properties. Critical CSS may be output to one or more files, as defined within the plugin options or within the CSS.
Stars: ✭ 84 (+104.88%)
Mutual labels:  postcss, postcss-plugin
Postcss Rtl
PostCSS plugin for RTL-adaptivity
Stars: ✭ 143 (+248.78%)
Mutual labels:  postcss, postcss-plugin
Postcss Spiffing
PostCSS plugin to use British English
Stars: ✭ 158 (+285.37%)
Mutual labels:  postcss, postcss-plugin
MinifyAllCli
📦 A lightweight, simple and easy npm tool to 𝗺𝗶𝗻𝗶𝗳𝘆 JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as 𝑪𝑳𝑰 tool or 𝒊𝒎𝒑𝒐𝒓𝒕𝒂𝒃𝒍𝒆 in TS/JS as a 𝑴𝑶𝑫𝑼𝑳𝑬 🥰
Stars: ✭ 21 (-48.78%)
Mutual labels:  minify, minification
postcss-windicss
PostCSS integrations for Windi CSS
Stars: ✭ 33 (-19.51%)
Mutual labels:  postcss, postcss-plugin

postcss-clean GitHub Workflow Status (branch) NPM Coveralls branch NPM Monthly Downloads

PostCss plugin to minify your CSS

Compression will be handled by clean-css, which according to this benchmark is one of the top (probably the best) libraries for minifying CSS.

Install

With npm do:

npm install postcss-clean --save

Example

Input

.try {
  color: #607d8b;
  width: 32px;
}

Output

.try{color:#607d8b;width:32px}

Input

:host {
  display: block;
}

:host ::content {
  & > * {
    color: var(--primary-color);
  }
}

Output

:host{display:block}:host ::content>*{color:var(--my-color)}

Note this example assumes you combined postcss-clean with other plugins (e.g. postcss-nesting).

API

clean([options])

Note that postcss-clean is an asynchronous processor. It cannot be used like this:

var out = postcss([ clean() ]).process(css).css;
console.log(out)

Instead make sure your runner uses the async APIs:

postcss([ clean() ]).process(css).then(function(out) {
    console.log(out.css);
});

options

It simply proxies the clean-css options. See the complete list of options here.

Usage

See the PostCSS documentation for examples for your environment.

Contributing

Pull requests are welcome.

License

MIT © Leonardo Di Donato


Analytics

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].