useless-css-checker
v0.2.0
Published
Unused CSS Checker. Built off of PurifyCSS
Downloads
686
Readme
Useless CSS Checker
A function that takes content (HTML/JS/etc) and CSS, and returns the validity of your unused selectors.
Installation
yarn add useless-css-checker -D
Usage
const uselessCssChecker = require('useless-css-checker')
module.exports.csscheck = () => {
const content = [
'dist/lib/main.js',
'dist/lib/vendor.js'
];
const css = [
'dist/lib/main.css',
'dist/lib/vendor.css'
];
const options = {
rejected: true,
validationOutput: true, // gives output on rejections
validationProcessExit: true, // determines if process.exit
whitelist: ['*white-list-testing*']
}
uselessCssChecker(content, css, options)
}