This package contains:
-
@leedomjs/tailwindcss-miniprogram-preset
is designed for miniprogram, and transformspx
torpx
. -
@leedomjs/tailwindcss-color-preset
collects some UI Frameworks' theme colors for Tailwind CSS.
pnpm add -D tailwindcss @leedomjs/tailwindcss-preset
/** @type {import('tailwindcss').Config} */
const preset = require('@leedomjs/tailwindcss-preset')
module.exports = {
presets: [
/**
* You can also set an object param that contains a field called `mp`.
* `mp` defaults to `false`, setting `mp` be `true` will enable the preset,
* otherwise will enable default config of tailwindcss and disable the preset meanwhile
*
* preset({ mp: true })
*/
preset,
],
content: [...],
theme: {
extend: {},
},
plugins: [],
...
}
- Use
-dv-
instead of/
to generate percentage - 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>