public
Last active

Stylus rems converter with fallback I haven't tested it very much. License MIT

  • Download Gist
rems.styl
Stylus
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// 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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.