Last active
August 29, 2015 14:08
-
-
Save thinsoldier/62484c86e15af3dbbd65 to your computer and use it in GitHub Desktop.
Show all calculated styles related to typography of an element
This file contains hidden or 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
function typographyInfo( element ) | |
{ | |
var styles = getComputedStyle(element); | |
var props = ['font-family','font-size','line-height','margin-top','margin-bottom','padding-top','padding-bottom']; | |
console.log(element); | |
for( i in props ) | |
{ | |
console.log( props[i] +': '+ styles[props[i]]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment