# cssrule.js **Repository Path**: mirrors_Orange-OpenSource/cssrule.js ## Basic Information - **Project Name**: cssrule.js - **Description**: A cross-browser JavaScript library to insert CSS rules - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 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 ? -------- ```javascript var myColor = "#2565ab"; cssrule.add("div { border-color: " + myColor + "}"); ``` You can see some live examples on [cssrule.js' simple website](http://orange-opensource.github.com/cssrule.js/).