@tailwind-expand/postcss
v0.3.2
Published
PostCSS plugin for tailwind-expand
Readme
@tailwind-expand/postcss
PostCSS plugin for tailwind-expand. Processes @expand blocks for Tailwind.
- Development: Generates semantic CSS classes (
.Button,.HomeHeroTitle) for debugging - Production: Generates
@source inline()for Tailwind to process utilities
Installation
For Next.js:
pnpm add -D @tailwind-expand/postcss @tailwind-expand/swcFor other frameworks:
pnpm add -D @tailwind-expand/postcss @tailwind-expand/babelUsage
With Tailwind CSS v4
// postcss.config.mjs
export default {
plugins: {
'@tailwind-expand/postcss': {},
'@tailwindcss/postcss': {},
},
}With Tailwind CSS v3
// postcss.config.js
module.exports = {
plugins: {
'@tailwind-expand/postcss': {},
tailwindcss: {},
autoprefixer: {},
},
}What It Does
- Extracts aliases from
@expandblocks - Scans source files for variant-prefixed aliases (e.g.,
lg:Button) - Development: Generates CSS classes (
.Button { @apply ... }) for debugging - Production: Injects
@source inline()for Tailwind to generate utilities
Options
{
// Directory to scan for source files (defaults to process.cwd())
root: './src',
// Optional merge function for conflicting utilities
mergerFn: twMerge,
}License
MIT
