2.0.9 • Published 12 months ago

checkcss v2.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

checkcss

Detect DOM elements that reference undefined CSS classes

Installation

npm install checkcss
# or
yarn add checkcss

Usage

import { CheckCSS } from 'checkcss';

// Create CheckCSS instance
const checkcss = new CheckCSS();
checkcss.scan().watch();

... then look for messages like this in your browser console: image

Hooks

The following hooks are supported:

// OPTIONAL: Hook for filtering classnames
checkcss.onClassnameDetected = function (classname, element) {
  // Return `false` to disable checks for `classname`.
  // For example, to ignore classnames starting with
  // "license-" or "maintainer-"...
  return /^license-|^maintainer-/.test(classname) ? false : true;
};

// OPTIONAL: Hook for custom logging
checkcss.onUndefinedClassname = function (classname) {
  // Custom logging goes here (replaces default log method)
};
2.0.9

12 months ago

2.0.7

1 year ago

2.0.8

1 year ago

2.0.6

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago