Skip to content

Instantly share code, notes, and snippets.

@JacobBennett
Created August 8, 2019 14:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save JacobBennett/1f3739c7d4c31ddd9e8d1f00658cfb52 to your computer and use it in GitHub Desktop.
Save JacobBennett/1f3739c7d4c31ddd9e8d1f00658cfb52 to your computer and use it in GitHub Desktop.
List all font styles being used on the page
var ret={};
$('*').each(function () {
var str = $(this).css('font-family');
str = str + ':' + $(this).css('font-weight');
str = str + ':' + $(this).css('font-style');
if (ret[str] ) {
ret[str] = ret[str] + 1;
} else {
ret[str] = 1;
}
});
console.log(ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment