Created
October 14, 2015 16:28
-
-
Save tobireif/85abf3d0ca11d2d32c00 to your computer and use it in GitHub Desktop.
Appending a rule to the last CSS stylesheet (using JS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var styleSheets = document.styleSheets; | |
var lastStyleSheet = styleSheets[styleSheets.length - 1]; | |
lastStyleSheet.insertRule( | |
"selector {prop: val}", lastStyleSheet.cssRules.length | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment