Last active
July 3, 2017 14:56
-
-
Save dan-cooke/ba83a098bd34984831f66e90b4e27760 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/tucokovega
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
'use strict'; | |
var container = document.getElementById('container'); | |
//create resource locally for testing | |
var stylesheet = '#container{background: red; width: 100px; height: 100px; display: block;}'; | |
var sBlob = new Blob([stylesheet], { type: 'text/css' }); | |
//get blob as a blob: url | |
var sBlobURL = (URL || webkitURL).createObjectURL(sBlob); | |
var link = document.createElement('link'); | |
link.href = sBlobURL; | |
link.rel = 'stylesheet'; | |
document.head.appendChild(link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment