Last active
June 1, 2021 13:51
-
-
Save petermekhaeil/f03702e4df759c0c3d303bde90975fa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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