Created
May 23, 2018 11:29
-
-
Save FoxSamu/94ef1fb39d16d9e773dc7343111cdf30 to your computer and use it in GitHub Desktop.
Default style in javascript
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 defstyles = "body {background-color: red}" | |
function setDefaultStyle(){ | |
var link = document.createElement("link") | |
var css = encodeURI(defstyles) | |
document.head.insertBefore(css, document.head.firstChild) | |
link.setAttribute("rel", "stylesheet") | |
link.setAttribute("href", "data:text/css,"+css) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment