Skip to content

Instantly share code, notes, and snippets.

@oakfang
Last active August 29, 2015 14:14
Show Gist options
  • Save oakfang/ab514fa869225bc1b56b to your computer and use it in GitHub Desktop.
Save oakfang/ab514fa869225bc1b56b to your computer and use it in GitHub Desktop.
Turn your beautiful style sheep into CSS style sheets with ease!
/*
sheep.js
Turn your beautiful style sheep into CSS style sheets with ease!
*/
(function (globals) {
var forEachDOM = function (selector, callback) {
Array.prototype.forEach.call(document.querySelectorAll(selector), callback);
};
globals.sheep = {
toStyleSheets: function () {
forEachDOM('link[rel="stylesheep"]', function (sheep) {
sheep.setAttribute('rel', 'stylesheet');
});
}
};
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment