JSPM

tailwindcss-convert-px-to-rem

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 990
  • Score
    100M100P100Q114454F
  • License ISC

Tailwind Css plugin convert dynamic classes from px to rem.

Package Exports

  • tailwindcss-convert-px-to-rem
  • tailwindcss-convert-px-to-rem/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tailwindcss-convert-px-to-rem) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Tailwind CSS Converter px-to-rem

Installation

npm install tailwindcss-convert-px-to-rem
//or
yarn add tailwindcss-convert-px-to-rem

Tailwind Config

module.exports  =  { 
    content:  ["./src/**/*.{html,js}"],
    theme:  { 
        extend:  {}, 
    }, 
    plugins:  [require('@tailwindcss-convert-px-to-rem')], //add here a plugin
}

Usage

You need add variant "rem:" before class. For, example:

<div class="rem:mt-[16px]">Hello World!</div> //convert to 1rem
<div class="rem:-top-[2px]">Hello World!</div> //convert to -0.125rem

<div class="mt-[16px]">Hello World!</div> //not convert to rem