Skip to content

Instantly share code, notes, and snippets.

@DeBelserArne
Forked from JacobBennett/fonts.js
Last active August 8, 2019 14:28
Show Gist options
  • Save DeBelserArne/586fdaafb74c3a5c0736defeced5655b to your computer and use it in GitHub Desktop.
Save DeBelserArne/586fdaafb74c3a5c0736defeced5655b to your computer and use it in GitHub Desktop.
List all font styles being used on the page
var ret={};
jQuery('*').each(function () {
var str = jQuery(this).css('font-family');
str = str + ':' + jQuery(this).css('font-weight');
str = str + ':' + jQuery(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