Socket
Socket
Sign inDemoInstall

@thedutchcoder/postcss-rem-to-px

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thedutchcoder/postcss-rem-to-px

PostCSS plugin to convert rem values to px values


Version published
Maintainers
1
Weekly downloads
4,351
increased by6.17%

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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • 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