All Projects β†’ komachi β†’ usedcss

komachi / usedcss

Licence: ISC License
PostCSS plugin which helps you extract only used styles.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to usedcss

Postcss Start To End
PostCSS plugin that lets you control your layout (LTR or RTL) through logical rather than physical rules
Stars: ✭ 18 (-65.38%)
Mutual labels:  postcss-plugins
Postcss Instagram
πŸ“· PostCSS plugin for using Instagram filters in CSS
Stars: ✭ 111 (+113.46%)
Mutual labels:  postcss-plugins
laggard
Automatically generate CSS fallbacks for legacy browsers, built on PostCSS
Stars: ✭ 23 (-55.77%)
Mutual labels:  postcss-plugins
Postcss Selector Not
PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to more compatible CSS (multiple css3 :not() selectors)
Stars: ✭ 49 (-5.77%)
Mutual labels:  postcss-plugins
Postcss Plugins
The "officially unofficial" consolidated list of PostCSS plugins in a ready-to-use package
Stars: ✭ 107 (+105.77%)
Mutual labels:  postcss-plugins
Rucksack
A little bag of CSS superpowers, built on PostCSS
Stars: ✭ 1,861 (+3478.85%)
Mutual labels:  postcss-plugins
Postcss Sorting
PostCSS plugin to keep rules and at-rules content in order.
Stars: ✭ 438 (+742.31%)
Mutual labels:  postcss-plugins
postcss-namespace
PostCSS plugin that prefix a namespace to a selector
Stars: ✭ 16 (-69.23%)
Mutual labels:  postcss-plugins
Postcss High Contrast
Create high contrast version of your project with ease.
Stars: ✭ 108 (+107.69%)
Mutual labels:  postcss-plugins
postcss-if-media
A PostCSS plugin to inline or nest media queries within CSS rules & properties.
Stars: ✭ 35 (-32.69%)
Mutual labels:  postcss-plugins
Postcss At Rules Variables
PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else and more...
Stars: ✭ 52 (+0%)
Mutual labels:  postcss-plugins
Postcss Font Family System Ui
PostCSS plugin to transform W3C CSS font-family: system-ui to a practical font-family list
Stars: ✭ 91 (+75%)
Mutual labels:  postcss-plugins
Stylefmt
stylefmt is a tool that automatically formats stylesheets.
Stars: ✭ 2,123 (+3982.69%)
Mutual labels:  postcss-plugins
Stencil Postcss
Autoprefixer plugin for Stencil
Stars: ✭ 19 (-63.46%)
Mutual labels:  postcss-plugins
postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (-55.77%)
Mutual labels:  postcss-plugins
Postcss Cssnext
`postcss-cssnext` has been deprecated in favor of `postcss-preset-env`.
Stars: ✭ 5,388 (+10261.54%)
Mutual labels:  postcss-plugins
Postcss Aspect Ratio Mini
A PostCSS plugin to fix an element's dimensions to an aspect ratio
Stars: ✭ 123 (+136.54%)
Mutual labels:  postcss-plugins
react-cli
基于 create-react-app ζ­ε»Ίηš„ε‰η«―θ„šζ‰‹ζžΆ
Stars: ✭ 18 (-65.38%)
Mutual labels:  postcss-plugins
postcss-clip-path-polyfill
PostCSS plugin which add SVG hack for clip-path property to make it work in Firefox
Stars: ✭ 24 (-53.85%)
Mutual labels:  postcss-plugins
postcss-stylestats
[Unmainted] PostCSS plugin for StyleStats.
Stars: ✭ 13 (-75%)
Mutual labels:  postcss-plugins

usedcss

PostCSS plugin which helps you extract only used styles. Unlike uncss and others does not render your pages to find used classes, but instead parse it statically, which can be beneficial in some cases. Also support simple Angular's ng-class parsing. And also, due to awesomeness of PostCSS, it works with LESS and SCSS via PostCSS syntaxes.

<!--- HTML file -->
<div class="test"></div>
/* Input */
.test { color: #000; }
.test2 { color: #fff; }
/* Output */
.test { color: #000; }

Installation

npm i usedcss --save

Options

html

Type: array of globs At least html or js option is required

HTML files to check css selector usage against them.

js

Type: array of globs At least html or js option is required

JS files to check css selector usage against them.

ignore

Type: array of strings

Saves ignored selectors even if they are not presented in DOM.

ignoreRegexp

Type: array of regexps

Use it to save selectors based on regexp.

ngclass

Type: boolean

Default: false

Parse or not to parse ng-class statements.

ignoreNesting

Type: boolean

Default: false

Ignore nesting so .class1 .class2 will be saved even if there is element with class2, but it's not nested with class1. Useful if you use templates.

templateMode

Type: boolean

Default: false

Useful if you run usedcss against nested templates. It split selectors so if you have an element with class class1 in one file and an element with class class2 in another one, it will save rule with .class1 .class2 selector.

templateCache

Type: boolean

Default: false

Check also for html presented in Angular's $templateCache. If you want to use this option, js option is required.

Usage

Check out PostCSS documentation on how to use PostCSS plugins.

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].