You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cssstylesheet

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssstylesheet

cross browser CSSStyleSheet

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cssstylesheet.js

Build Status NPM version

cross browser CSSStyleSheet

Installation

$ npm install cssstylesheet

Usage

<script src="cssstylesheet.min.js"></script>

Example

const sheet = cssstylesheet.create();  // or sheet = new cssstylesheet();

// add css rule
sheet.addRule('body', 'background-color: #ccccff;');

// remove all
sheet.clearRule();

Functions

cssstylesheet

cssstylesheet constructor.

cssstylesheet#insertRule(selector, ruleText, index)

  • selector
    • String
  • ruleText
    • String
  • index
    • Number

insert rule at index.

cssstylesheet#deleteRule(index)

  • index
    • Number

delete rule of index.

cssstylesheet#addRule(selector, ruleText)

  • selector
    • String
  • ruleText
    • String

add rule at last.

cssstylesheet#clearRule()

delete all rule.

cssstylesheet#getElement()

return HTMLStyleElement, but return null if browser is old IE.

cssstylesheet#getSheet()

return CSSStyleSheet.

cssstylesheet#getRules()

return CSSRuleList.

cssstylesheet.create()

create cssstylesheet instance.

License

The MIT license.

FAQs

Package last updated on 30 Dec 2018

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