🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

csstate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csstate

Simple library for handling different css states and properties. Made for testing css related things with mocha or something like this.

1.1.1
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

CSState

Simple dynamic CSS style handling tool.

Build Status Coveralls npm version license Standard - JavaScript Style Guide

Installation

npm i --save-dev csstate

Usage

  var CSSTate = require('csstate');
  var cst = new CSSTate();

  cst.rule({
    'body': {
      'font-size': '18px'
    }
  });

  cst.exit();

Check out How to test DOM elements with CSSTate tutorial.

Features

Create/modify rules

rule(selector, property, value)

rule(object)

Remove rules

remove(selector)

remove(selector, proprery)

remove(object) - remove specified properties

remove(object, true) - remove by selectors, executes remove(selector) for each selector inside of the object.

Remove stylesheet

exit()

Usage in tests

  beforeEach(() => {
    cst.rule(defaultRules); // Load default rules
  });

  afterEach(() => {
    cst.exit(); // Remove entire stylesheet
  });

See the example.

License

MIT (c) 2017 Svetlana Linuxenko

Keywords

css

FAQs

Package last updated on 02 Nov 2019

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