TailwindPHP

A 1:1 port of TailwindCSS 4.x to PHP. Generate Tailwind utility CSS with pure PHP — no Node.js, no build step. Ships cn(), tailwind-merge, CVA, the typography and forms plugins, and a drop-in CLI.

Pure PHP

No Node.js, no build step, no extensions beyond a standard PHP 8.2+ build. composer require and go.

TailwindCSS 4.x, 1:1

A complete port of Tailwind v4.3 — the same utilities, variants, directives, and byte-for-byte CSS output.

4,000+ tests

Output is verified against TailwindCSS's own test suites, extracted from the TypeScript source and re-run on every push.

Every utility & variant

All 364 utilities and every variant: hover, focus, responsive, dark mode, container queries, and arbitrary values.

CSS directives

@theme, @apply, @utility, @custom-variant, @layer, @plugin, and @source — all parsed and resolved natively.

Runtime generation

Generate utility CSS on the fly from HTML, database content, or template variables. No build step required.

Batteries included

cn(), merge(), and variants() — clsx, tailwind-merge, and CVA ported to PHP, with no extra packages.

Plugins

@tailwindcss/typography and @tailwindcss/forms ported in full, plus a PHP plugin API for writing your own.

Drop-in CLI

bin/tailwindphp mirrors @tailwindcss/cli: -i, -o, --watch, --minify, --optimize, and @source scanning.

Inspect the theme

Read raw and computed property values, colors, breakpoints, and spacing for any class straight from PHP.

Production-ready

A built-in CSS minifier and a file cache with TTL keep repeated builds fast and output lean.

WordPress & PHP frameworks

Ship Tailwind-powered themes and plugins with zero Node.js in the stack — just a Composer dependency.

Generate Tailwind CSS from PHP.

Install the Composer package and compile your first stylesheet in seconds — no Node.js required.

Read the Docs