You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@thedutchcoder/postcss-rem-to-px

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

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
Weekly downloads
3.9K
decreased by-6.31%
Maintainers
1
Created
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

Package last updated on 24 Nov 2021

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc