Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gravityblast/style-rule

Made in CoffeeScript, it adds the ability to manage css style rules from javascript.
https://github.com/gravityblast/style-rule

Last synced: about 10 hours ago
JSON representation

Made in CoffeeScript, it adds the ability to manage css style rules from javascript.

Awesome Lists containing this project

README

        

#StyleRule

Cross-browser css style rules management from javascript.

##Example

var styleRule = new StyleRule();
var index_red = styleRule.add("body", "background: red;");
var index_yellow = styleRule.add("body", "background: yellow;");
var index_blue = styleRule.add("body", "background: blue;");
var index_brown = styleRule.add("body", "background: brown;");

styleRule.replace(index_blue, "body", "background: violet;");
styleRule.remove(index_yellow);