JSPM

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

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

Package Exports

  • checkcss

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 tha treference undefined CSS classes. (Useful for React apps, single-page apps that dynamically update the DOM.)

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

Installation

npm i checkcss

Usage

import checkCSS, { monitorCSS } from 'checkcss';

// Check current DOM
checkCSS();

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