Skip to content

Ometria/remove-unused-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remove-unused-css

Small module that, given some CSS and a static HTML file, filters out unused CSS rules. Also works with rules inside media queries.

Works by parsing the CSS and checking for the presence of the target elements in the HTML.

Developed for optimizing emails created using a CSS framework.

Install

Directly from github, at this point:

npm install Ometria/remove-unused-css --save

Usage

import removeUnusedCss from 'remove-unused-css'

let newCss = removeUnusedCss(htmlFileContents, cssFileContents);

About

Small module for filtering out unused css rules

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •