Skip to content

Instantly share code, notes, and snippets.

@thinsoldier
Last active August 29, 2015 14:08
Show Gist options
  • Save thinsoldier/62484c86e15af3dbbd65 to your computer and use it in GitHub Desktop.
Save thinsoldier/62484c86e15af3dbbd65 to your computer and use it in GitHub Desktop.
Show all calculated styles related to typography of an element
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