JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 88
  • Score
    100M100P100Q71149F
  • License ISC

Utility method for warning when elements have a `class` attribute that refers to an undefined CSS class

Package Exports

  • checkcss
  • checkcss/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (checkcss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

checkcss

Utility method for warning any time the class attribute of an element references an undefined CSS class.

This module provides two methods:

  • checkCSS() performs a one-time sweep of the DOM.
  • monitorCSS() Sets up a MutationObserver to continuously monitor DOM changes, looking for elements that reference undefined CSS classes.

(Note: monitorCSS() is fairly efficient but is probably not something you want to be running in production.)

Installation

npm i checkcss

Usage

import checkCSS, { ignoreCSS, monitorCSS } from 'checkcss';

// (optional) Set a regex for classnames to ignore
ignoreCSS(/^license-|^maintainer-/);

// Check current DOM
checkCSS();

// ... and setup monitor to check DOM as it changes
monitorCSS();