cssstylesheet.js
cross browser CSSStyleSheet
Installation
$ npm install cssstylesheet
Usage
Example
const sheet = cssstylesheet; // or sheet = new cssstylesheet(); // add css rulesheet; // remove allsheet;
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.