Menu
function addCssRules(selector, rules, /*Optional*/ sheetName) ', styleSheet.cssRules. Works with FF, Chrome, and IE9+ (maybe earlier too, untested). It will make at most one new style element and re-use it on future function calls). Here's my general-purpose function which parametrizes the CSS selector and rules, and optionally takes in a css filename (case-sensitive) if you wish to add to a particular sheet instead (otherwise, if you don't provide a CSS filename, it will create a new style element and append it to the existing head.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |