Skip to content

Orange-OpenSource/cssrule.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cssrule.js, a cross-browser library for programmatically adding CSS rules

Why ?

Sometimes we need an easy way to dynamically add new rules. For example, we can generate selectors on the fly, but property values as well.

Unfortunately, it doesn't seem so easy to do in a cross-browser way. That's why this library was born.

How ?

Just call cssrule.add(rule). rule must be a string with a valid CSS rule, which means selector, properties and values.

An example ?

var myColor = "#2565ab";
cssrule.add("div { border-color: " + myColor + "}");

You can see some live examples on cssrule.js' simple website.

About

A cross-browser JavaScript library to insert CSS rules

Resources

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
GPL-LICENSE.txt
MIT
MIT-LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published