Created
February 28, 2017 13:07
-
-
Save Sleavely/5cb70678d840f6408c2d420ecb0b3cff to your computer and use it in GitHub Desktop.
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
(function () { | |
var newcss = '#myDiv { -webkit-filter: blur(8px) grayscale(1); }'; | |
newcss += '#hideSomething { display: none; }'; | |
newcss += '#makeItGreen { background: #00ff00; }'; | |
if ('\v' == 'v') /* ie only */ { | |
document.createStyleSheet().cssText = newcss; | |
} else { | |
var tag = document.createElement('style'); | |
tag.type = 'text/css'; | |
document.getElementsByTagName('head')[0].appendChild(tag); | |
tag[(typeof document.body.style.WebkitAppearance == 'string') /* webkit only */ ? 'innerText' : 'innerHTML'] = newcss; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment