0.0.0 • Published 1 year ago

@skipper-hospitality/postcss-rem-to-em-plugin v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

postcss-rem-to-em-plugin

PostCSS plugin that converts 'rem' references to 'em' references.

.foo {
  font-size: 30rem;
}
.foo {
  font-size: 30em;
}

Usage

Step 1: Install plugin:

npm install --save-dev postcss postcss-rem-to-em-plugin

Step 2: 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 do not use PostCSS, add it according to official docs and set this plugin in settings.

Step 3: Add the plugin to plugins list. If you are using a PostCSS postprocessor and bundler like TailwindCSS, you will want to run this after it:

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