Skip to content

Instantly share code, notes, and snippets.

@LucaColonnello
Created October 30, 2014 10:28
Show Gist options
  • Save LucaColonnello/791bf40d104984ba0ed6 to your computer and use it in GitHub Desktop.
Save LucaColonnello/791bf40d104984ba0ed6 to your computer and use it in GitHub Desktop.
Get Element EM Size
function getEmSize(el) {
return Number(getComputedStyle(el, "").fontSize.match(/(\d+(\.\d*)?)px/)[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment