Package Exports
- plugwind.js
- plugwind.js/package.json
- plugwind.js/utils
Readme
🧩 PlugWind
PlugWind makes it easy to create TailwindCSS plugins.
🚀 Installation
You can install PlugWind
from NPM
or JSR
:
Using
npm
:From
NPM
:npm install plugwind.js
From
JSR
:npx jsr add @siguici/plugwind
Using
Yarn
:From
NPM
:yarn add plugwind.js
From
JSR
:yarn dlx jsr add @siguici/plugwind
Using
PNPM
:From
NPM
:pnpm add plugwind.js
From
JSR
:pnpm dlx jsr add @siguici/plugwind
Using
Bun
:From
NPM
:bun install plugwind.js
From
JSR
:bunx jsr add @siguici/plugwind
Using
Deno
:From
NPM
:deno install npm:plugwind.js
From
JSR
:deno add @siguici/plugwind
Without install:
import plugwind.js from 'jsr:@siguici/plugwind';
💡 Usage
Import from
node_modules
:import plug from 'plugwind.js';
Import without install (using
Deno
):import plug from 'jsr:@siguici/plugwind';
Use the
plug
function to define a plugin:export default plug(({ plugin }) => { plugin .addBase(base) .addDark(className, lightRule, darkRule) .addVar(varName, varValue, varPrefix = 'tw')) .addComponent(className, rule) .addComponents(components) .addUtility(className, style) .addUtilities(utilities) .addVariant(variants); });
Use the
plug.with
method to define a plugin with options:export default plug.with<{ prefix?: string }>(({ plugin, options }) => { plugin.addVar(name, $value, options.prefix ?? 'tw'); });
📄 License
This project is licensed under the MIT License - see the LICENSE.md file for details.