Last active
August 29, 2015 14:23
-
-
Save robinweser/9dfd78ce5e58513a1eda to your computer and use it in GitHub Desktop.
fastest way to manually apply a stylesheet to your document
This file contains hidden or 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
//creates a new <style></style>-tag | |
var style = document.createElement('style'); | |
/*** GENERATE CSS HERE ***/ | |
//adds the whole css rules to your styles tag | |
style.appendChild(document.createTextNode(CSS)); | |
//applied it to your head which now start effecting your DOM | |
document.head.appendChild(style) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment