A build-time tool your app uses to compile its Tailwind CSS. It manages the Tailwind CLI binary so you can build and watch styles without reaching for a Node setup.
Tailwind is a utility-first CSS framework: you style directly in your markup with classes, and a build step scans your templates to emit only the CSS you use. ForgeTailwind is the piece that wires that build into your app.
It is a command-line capability — it registers no request middleware and no runtime services. All it does is run the Tailwind CLI for you: fetch the standalone binary, build your styles on demand, and watch for changes while you develop.
A note on scope: ForgeTailwind only compiles CSS. Your classes, the Tailwind config, and the design system all live in your app — this capability is just the build pipeline around them.
php forge.php package:install-module --module=ForgeTailwind
That adds the two CLI commands and the helper function to your app. There is no runtime setup — the module only needs to be present for the build commands to exist.
To compile your styles once, run the build command. On the first run it downloads the Tailwind binary automatically; after that it just files your source into the output:
php forge.php modules:tailwind:build
# custom input/output
php forge.php modules:tailwind:build --input=app/UI/assets/css/tailwind.css --output=public/assets/css/app.css
By default it reads
app/UI/assets/css/tailwind.css and
writes public/assets/css/app.css,
minified. Point --input and
--output anywhere you like.
During development you'll usually keep a watch running so styles rebuild every time your markup changes:
php forge.php modules:tailwind:watch
# on a specific platform's binary
php forge.php modules:tailwind:watch --platform=linux-x64
Normally your app just links the compiled CSS. When
you want instant reflection of markup changes, the
forgetailwind() helper emits the hot
reload script — but only when it's safe to:
APP_HMR is enabled, andlocalhost / 127.0.0.1).In every other situation the helper returns an empty string, so your production markup stays clean.
ForgeTailwind uses the official standalone Tailwind CLI, downloaded on demand and cached locally — no Node or npm required. The first time you build or watch, it:
storage/bin/ (skipping download
if one already exists).
The build command always targets the
macos-arm64 binary, while the watch
command lets you pick your platform explicitly.
| Item | Default |
|---|---|
| Input CSS | app/UI/assets/css/tailwind.css |
| Output CSS | public/assets/css/app.css |
| Binary directory | storage/bin/ |
| Hot reload flag | APP_HMR |
The watch command recognises every binary Tailwind publishes, so you can run the same setup across machines:
macos-arm64, macos-x64windows-x64linux-arm64, linux-arm64-musllinux-x64, linux-x64-musl