Skip to content

Instantly share code, notes, and snippets.

@rdillmanCN
Created December 30, 2017 09:19
Show Gist options
  • Save rdillmanCN/cd4d071e161d9605d86fdb82b563d983 to your computer and use it in GitHub Desktop.
Save rdillmanCN/cd4d071e161d9605d86fdb82b563d983 to your computer and use it in GitHub Desktop.
List all style blocks and sheets used within the page, and output to the console.
(function() {
var tab = [].slice.call(document.styleSheets).map(function(e) {
return {
size: e.cssRules.length / 1e3 + " kb",
url: e.href || "Block"
}
});
console.group("CSS Data");
console.table(tab);
console.groupEnd("CSS Data");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment