postcss-remtopx icon indicating copy to clipboard operation
postcss-remtopx copied to clipboard

PostCSS plugin for converting rem to px


Build Status Dependency Status

PostCSS plugin for converting rem to px.

Getting Started

Install remtopx: npm install --save-dev postcss-remtopx

Include remtopx and execute:

var postcss = require('postcss');
var remtopx = require('postcss-remtopx');

var output = postcss([remtopx]).process('body { padding: 2rem; }');
// body { padding: 32px; }


var output = postcss([remtopx({ rootFontSize: 14 })]).process('body { padding: 2rem; }');
// body { padding: 28px; }


Type: float Default: 16

Changes the root font size used to calculate the rem pixel values.


postcss-remtopx is released under the ISC license.

Copyright © 2016, Roland Warmerdam.