tailwindcss-rem2px-preset
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

tailwindcss-rem2px-preset

Allow configuration for using px instead of rem.

Default: 1rem -> 16px, Of course you can custom this

Usage

Default

1rem -> 16px

// tailwind.config.js

module.exports = {
  presets: [
    require('tailwindcss-rem2px-preset')
  ],
  // ...
}

Custom

For weapp developers, we need to use rpx instead of rem

e.g: 1rem -> 32rpx

// tailwind.config.js

module.exports = {
  presets: [
    require('tailwindcss-rem2px-preset').createPreset({
      fontSize: 32,
      unit: 'rpx'
    })
  ],
  // ...
}

Package Sidebar

Install

npm i tailwindcss-rem2px-preset

Weekly Downloads

185

Version

1.0.3

License

MIT

Unpacked Size

6.71 kB

Total Files

10

Last publish

Collaborators

  • icebreaker