Last active
September 16, 2016 08:11
-
-
Save marcelweder/d1c004cd96b74ce8c5cf7cdb07535bff to your computer and use it in GitHub Desktop.
REM Calculator
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
/** | |
* Calculate pixel to rem | |
* @param size [int] pixel size to convert | |
* @param base [int] html font-size in pixel | |
*/ | |
function calcRem(size, base) { | |
return parseFloat((size / base).toPrecision(4)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment