Skip to content

A helper script that takes provided content (eg: HTML/JS/etc) and compares with provided CSS to return the validity of your selectors.

Notifications You must be signed in to change notification settings

ssulivan11/useless-css-checker

Repository files navigation

DEPRECATED - feel free to use, but some known issues and the outdated state of this package do not warrant its use in pipelines or valid checks

Useless CSS Checker

A function that takes content (HTML/JS/etc) and CSS, and returns the validity of your unused selectors.

Installation

npm install useless-css-checker --save-dev

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)
}

Success:

Imgur

Failure:

Imgur

About

A helper script that takes provided content (eg: HTML/JS/etc) and compares with provided CSS to return the validity of your selectors.

Resources

Stars

Watchers

Forks

Packages

No packages published