Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

@thedutchcoder/postcss-rem-to-px

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

@thedutchcoder/postcss-rem-to-px

PostCSS plugin to convert rem values to px values

    0.0.2latest
    GitHub

Version published
Maintainers
1
Weekly downloads
789
increased by40.89%

Weekly downloads

Readme

Source

postcss-rem-to-px

PostCSS plugin to convert rem values to px values.

.foo { margin: 2rem; } .foo { margin: 32px; }

Usage

Step 1: Install plugin:

npm install --save-dev postcss postcss-rem-to-px

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

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

Step 3: Add the plugin to plugins list:

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

Options

You can set a baseValue to represent the body's root pixel value for font-size, which is the base for rem values. The default baseValue is 16.

module.exports = { plugins: [ + require('@thedutchcoder/postcss-rem-to-px', { baseValue: 10 }), require('autoprefixer') ] }

Keywords

FAQs

Last updated on 24 Nov 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc