SolidToken.Tailwind.MSBuild 4.0.0-preview.4

Prefix Reserved
This is a prerelease version of SolidToken.Tailwind.MSBuild.
dotnet add package SolidToken.Tailwind.MSBuild --version 4.0.0-preview.4
                    
NuGet\Install-Package SolidToken.Tailwind.MSBuild -Version 4.0.0-preview.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SolidToken.Tailwind.MSBuild" Version="4.0.0-preview.4">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SolidToken.Tailwind.MSBuild" Version="4.0.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="SolidToken.Tailwind.MSBuild">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SolidToken.Tailwind.MSBuild --version 4.0.0-preview.4
                    
#r "nuget: SolidToken.Tailwind.MSBuild, 4.0.0-preview.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SolidToken.Tailwind.MSBuild@4.0.0-preview.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SolidToken.Tailwind.MSBuild&version=4.0.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SolidToken.Tailwind.MSBuild&version=4.0.0-preview.4&prerelease
                    
Install as a Cake Tool

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

  1. Add the package to your project.

  2. Create wwwroot/app.css (the default input path) with:

    @import "tailwindcss";
    
  3. Reference the output in your layout (App.razor or _Host.cshtml):

    <link rel="stylesheet" href="app.min.css" />
    
  4. Build. The CLI is downloaded on first build and cached — subsequent builds are instant.

How it works

On every build, Tailwind.MSBuild:

  1. Downloads the Tailwind standalone CLI for the current OS/architecture and caches it at ~/.nuget/packages/.tools/tailwindcss/{version}/.
  2. Runs tailwindcss -i app.css -o app.min.css before compilation (with --minify in Release builds).
  3. 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
There are no supported framework assets in this package.

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