Created
October 30, 2014 10:28
-
-
Save LucaColonnello/791bf40d104984ba0ed6 to your computer and use it in GitHub Desktop.
Get Element EM Size
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
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