This package has been deprecated

Author message:

unmaintained

cssstylesheet

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i cssstylesheet

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

37.7 kB

Total Files

14

Last publish

Collaborators

  • sasaplus1