A SASS function for converting px
to em
.
npm install --save sass-ems
$ sass-composer example/example.scss -o compiled.css
SCSS: example/settings.scss
//this is the default setting if not specified by the user
$base-font-size: 16px;
SCSS: example/example.scss
@import "./settings";
@import "sass-ems";
h1 {
padding: em(15px);
font-size: em(24px);
}
CSS: compiled.css
h1 {
padding: 0.9375em;
font-size: 1.5em; }
Convert a px
value to em
.
The MIT License (MIT)
Copyright (c) 2015 James Newell