@real-digital/postcss-class-checker

1.0.4 • Public • Published

postcss-class-checker

This repository contains a postCSS plugin to check the CSS code for selectors.

Installation

Simply install this plugin with the following command:

npm install --save-dev @real-digital/postcss-class-checker

Usage

postcss([
    classChecker({
        expected: [
            '.my-button',
            '.my-table',
            '#uniq-wrapper',
        ],
        blacklist: [
            '.useless-class',
        ],
    })
])

If you are missing selectors in your CSS that you expect or there are selectors that you don't want to have, then this plugin will throw an error.

This plugin does not transform CSS code, it only serves to test the compiled CSS code.

Options

Available options are:

  • expected (array): list of selectors you expect in your css file.
  • blacklist (array): list of selectors you do NOT want in your css file.

Planned Features

  • Improve error handling (postCSS Warning?)

Package Sidebar

Install

npm i @real-digital/postcss-class-checker

Weekly Downloads

0

Version

1.0.4

License

none

Unpacked Size

4.52 kB

Total Files

5

Last publish

Collaborators

  • khazl
  • realdigital
  • rkpauls
  • zonradkuse