SolidToken.Tailwind.MSBuild
4.0.0-preview.4
Prefix Reserved
dotnet add package SolidToken.Tailwind.MSBuild --version 4.0.0-preview.4
NuGet\Install-Package SolidToken.Tailwind.MSBuild -Version 4.0.0-preview.4
<PackageReference Include="SolidToken.Tailwind.MSBuild" Version="4.0.0-preview.4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="SolidToken.Tailwind.MSBuild" Version="4.0.0-preview.4" />
<PackageReference Include="SolidToken.Tailwind.MSBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add SolidToken.Tailwind.MSBuild --version 4.0.0-preview.4
#r "nuget: SolidToken.Tailwind.MSBuild, 4.0.0-preview.4"
#:package SolidToken.Tailwind.MSBuild@4.0.0-preview.4
#addin nuget:?package=SolidToken.Tailwind.MSBuild&version=4.0.0-preview.4&prerelease
#tool nuget:?package=SolidToken.Tailwind.MSBuild&version=4.0.0-preview.4&prerelease
Tailwind.MSBuild
Automatically downloads and runs the Tailwind CSS CLI as part of your .NET build. No Node.js required.
<PackageReference Include="Tailwind.MSBuild" Version="4.*" />
Getting started
Add the package to your project.
Create
wwwroot/app.css(the default input path) with:@import "tailwindcss";Reference the output in your layout (
App.razoror_Host.cshtml):<link rel="stylesheet" href="app.min.css" />Build. The CLI is downloaded on first build and cached — subsequent builds are instant.
How it works
On every build, Tailwind.MSBuild:
- Downloads the Tailwind standalone CLI for the current OS/architecture and caches it at
~/.nuget/packages/.tools/tailwindcss/{version}/. - Runs
tailwindcss -i app.css -o app.min.cssbefore compilation (with--minifyin Release builds). - Skips both steps if the output is already up-to-date (incremental build support).
Tailwind v4 scans your .razor, .html, and .cshtml files automatically — no tailwind.config.js needed.
Configuration
Override any property in your .csproj or Directory.Build.props:
<PropertyGroup>
<TailwindVersion>4.1.3</TailwindVersion>
<TailwindInputCss>$(MSBuildProjectDirectory)\wwwroot\app.css</TailwindInputCss>
<TailwindOutputCss>$(MSBuildProjectDirectory)\wwwroot\app.min.css</TailwindOutputCss>
<TailwindMinify>true</TailwindMinify>
<EnableTailwind>false</EnableTailwind>
<TailwindCliPath>/usr/local/bin/tailwindcss</TailwindCliPath>
<TailwindAdditionalArguments>--verbose</TailwindAdditionalArguments>
</PropertyGroup>
CI/CD
The CLI binary is cached inside the NuGet packages directory, so it's automatically preserved by standard NuGet caching steps.
GitHub Actions:
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
For air-gapped environments, download the CLI separately and set <TailwindCliPath> to point at it. Set <TailwindSkipInstall>true</TailwindSkipInstall> to suppress the download attempt entirely.
Watch mode
To run Tailwind in watch mode alongside dotnet watch run, open a second terminal and run:
dotnet msbuild -t:TailwindWatch
Versioning
The major version of Tailwind.MSBuild matches the major version of Tailwind CSS it targets. Use 4.* to get the latest Tailwind v4-compatible release.
Platform support
| OS | x64 | arm64 |
|---|---|---|
| Windows | ✓ | — |
| Linux | ✓ | ✓ |
| macOS | ✓ | ✓ |
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0-preview.4 | 52 | 4/10/2026 |
| 4.0.0-preview.3 | 66 | 3/22/2026 |
| 4.0.0-preview.2 | 41 | 3/22/2026 |
| 4.0.0-preview.1 | 44 | 3/22/2026 |
| 4.0.0-preview.0 | 49 | 3/22/2026 |