Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

checkcss

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkcss

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

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
186
increased by7.51%
Maintainers
1
Weekly downloads
 
Created
Source

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();

Keywords

FAQs

Package last updated on 15 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc