Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var elems = document.getElementsByTagName('*');
var usages = {};
for (var i = 0; i < elems.length; i++) {
var elemStyles = document.defaultView.getComputedStyle(elems[i], null);
var font = elemStyles.getPropertyValue('font-family').split(',')[0];
var weight = elemStyles.getPropertyValue('font-weight');
var style = elemStyles.getPropertyValue('font-style');
var fontName = `${font} ${weight} ${style}`;
if ((fontName.indexOf('Sephora') !== -1) || (fontName.indexOf('avalon') !== -1)) {
usages[fontName] = (usages[fontName] || 0) + 1;
}
}
console.table(usages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment