Skip to content

Instantly share code, notes, and snippets.

@guo-yu
Created September 25, 2013 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guo-yu/6699995 to your computer and use it in GitHub Desktop.
Save guo-yu/6699995 to your computer and use it in GitHub Desktop.
(function ($) {
var rules = document.styleSheets[document.styleSheets.length-1].cssRules;
for (var idx = 0, len = rules.length; idx < len; idx++) {
$(rules[idx].selectorText).each(function (i, elem) {
elem.style.cssText += rules[idx].style.cssText;
});
}
$('style').remove();
$('script').remove();
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment