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/plugwindUsing
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.jsFrom
JSR:bunx jsr add @siguici/plugwindUsing
Deno:From
NPM:deno install npm:plugwind.jsFrom
JSR:deno add @siguici/plugwindWithout 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
plugfunction 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.withmethod 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.