Created
August 8, 2019 14:22
-
-
Save JacobBennett/1f3739c7d4c31ddd9e8d1f00658cfb52 to your computer and use it in GitHub Desktop.
List all font styles being used on the page
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 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