Last active
December 17, 2015 23:49
-
-
Save avilaj/5691958 to your computer and use it in GitHub Desktop.
Stylus rems converter with fallback I haven't tested it very much. License MIT
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
// License MIT | |
// Author: Jorge Avila <jorge.e.avila@gmail.com> | |
// Example: | |
// body | |
// -rems('margin', 10 20 30 40) | |
basefont = 16px | |
-rems(property, sizes) | |
rems = new array() | |
pixs = new array() | |
for prop, i in sizes | |
pixs[i] = prop*basefont | |
rems[i] = prop*1rem | |
{property}: pixs | |
{property}: rems |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment