@leedomjs/tailwindcss-miniprogram-preset
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

@leedomjs/tailwindcss-miniprogram-preset

npm

This package is designed for miniprogram, and transforms px to rpx. 0.25rem = 4px = 8rpx

Usage

Install

pnpm add -D tailwindcss @leedomjs/tailwindcss-miniprogram-preset

Config tailwind.config.js

/** @type {import('tailwindcss').Config} */

const mp = require('@leedomjs/tailwindcss-miniprogram-preset')

module.exports = {
  presets: [
    /**
     * You can also set an object param that contains a field called `enable`.
     * `enable` defaults to `true`, setting `enable` be `false` will enable default config of tailwindcss and disable the preset meanwhile.
     * 
     * mp({
     *  enable: false
     * })
     */
    mp(),
  ],
  content: [...],
  theme: {
    extend: {},
  },
  plugins: [],
  ...
}

Tips

  1. Use -dv- instead of / to generate percentage
  2. Use - instead of .

For example:

<!-- w-1/2 = w-1-dv-2 -->
<div class="w-1/2 w-1-dv-2">hello, world.</div>

<!-- w-1.5 = w-1-5 -->
<div class="w-1.5 w-1-5">hello, world.</div>

License

MIT License © 2024-present Leedom

Package Sidebar

Install

npm i @leedomjs/tailwindcss-miniprogram-preset

Weekly Downloads

85

Version

0.7.0

License

MIT

Unpacked Size

8.87 kB

Total Files

8

Last publish

Collaborators

  • leedom92