Skip to content

jakeols/css-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@jakeols/css-cleaner

Small utility to find unused CSS classes in your HTML files, allowing you to purge them. Made for static sites where there is a large number of generated .html files with a lot of compiled styles. Requires Node > 12.x

Installation

Install via npm or yarn globally

$ npm install @jakeols/css-cleaner -g

Usage

css-cleaner --help will show the following CLI args

Options:
  -s, --styles     The path to your styles.                           [required]
  -t, --templates  The path to your templates                         [required]
  -h, --help       Show help                                           [boolean]
  -v, --version    Show version number                                 [boolean]

Examples:
  css-cleaner -s=style.css -t=index.html  Print unused styles from given
                                          templates

Note: --templates and --styles can be files, or directories.

Todo

  • Support parsing other file types (such as .js / .jsx , .php, .hbs, etc.) for class or className (configurable)

About

Find unused css selectors in your code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published