Last active
March 3, 2016 21:14
-
-
Save CodyKochmann/243d51ac3d056dde57de to your computer and use it in GitHub Desktop.
loads a stylesheet into the page head
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
load_style=(css)-> | |
l = document.createElement('style') | |
l.innerHTML = css | |
l.type = 'text/css' | |
document.getElementsByTagName('head')[0].appendChild(l) | |
return | |
load_css=(url)-> | |
l = document.createElement('link') | |
l.src = url | |
l.rel = 'stylesheet' | |
l.type = 'text/css' | |
document.getElementsByTagName('head')[0].appendChild(l) | |
return | |
load_style(".mw-body-content{max-width: 6.5in;margin: 0 auto;}") |
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 load_css = function(input_url){ | |
// loads a stylesheet into the page head | |
// by: Cody Kochmann | |
var l = document.createElement("link"); | |
l.src=input_url; | |
l.rel="stylesheet"; | |
l.type="text/css"; | |
document.getElementsByTagName("head")[0].appendChild(l); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment