Stylecow plugin to add a fallback in pixels for browsers not supporting rem values.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

stylecow plugin rem

Build Status

Stylecow plugin to add a fallback in pixels for browsers not supporting rem values. More info about rem

You write:

p {
	font-size: 2rem;
}

And stylecow converts to:

p {
	font-size: 32px;
	font-size: 2rem;
}

To change the default value of rem (16px) just create a font-size declaration in a :root or html rule:

:root {
	font-size: 0.5em;
}
p {
	font-size: 2rem;
}

becomes to:

:root {
	font-size: 0.5em;
}
p {
	font-size: 16px;
	font-size: 2rem;
}

More demos in the tests folder