Permalink
8578e6a Mar 20, 2014
27 lines (15 sloc) 540 Bytes

Functions for converting pixel values into em (px2em) or rem (px2rem) values

For both functions the optional second argument is base font-size for calculation though usually not required when converting pixel to rem.

Settings

px2em-base

The default base pixel value (16px by default) used for px2em conversion.

px2rem-base

The default base pixel value (16px by default) used for px2rem conversion.

font-size: px2em(11 13);
font-size: px2rem(16);
font-size: .84615em;
font-size: 1rem;