@harrytwigg/postcss-rem-to-px

1.0.2 • Public • Published

PostCSS Rem To Px

Fork of original repo by tillschander that uses pixel rounding

PostCSS plugin to replace all rem values with px values.

.foo {
  /* Input example */
  font-size: 1rem;
  margin: 1rem 0 .5rem 0;
}
.foo {
  /* Output example */
  font-size: 16px;
  margin: 16px 0 8px 0;
}

Usage

Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you already use PostCSS, add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-rem-to-px')({ baseSize: 16 }),
    require('autoprefixer')
  ]
}

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

Package Sidebar

Install

npm i @harrytwigg/postcss-rem-to-px

Weekly Downloads

67

Version

1.0.2

License

MIT

Unpacked Size

4.08 kB

Total Files

5

Last publish

Collaborators

  • harrytwigg