DotnetDevKR.TailwindCSS 4.1.18.1

dotnet add package DotnetDevKR.TailwindCSS --version 4.1.18.1
                    
NuGet\Install-Package DotnetDevKR.TailwindCSS -Version 4.1.18.1
                    
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="DotnetDevKR.TailwindCSS" Version="4.1.18.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotnetDevKR.TailwindCSS" Version="4.1.18.1" />
                    
Directory.Packages.props
<PackageReference Include="DotnetDevKR.TailwindCSS" />
                    
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 DotnetDevKR.TailwindCSS --version 4.1.18.1
                    
#r "nuget: DotnetDevKR.TailwindCSS, 4.1.18.1"
                    
#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 DotnetDevKR.TailwindCSS@4.1.18.1
                    
#: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=DotnetDevKR.TailwindCSS&version=4.1.18.1
                    
Install as a Cake Addin
#tool nuget:?package=DotnetDevKR.TailwindCSS&version=4.1.18.1
                    
Install as a Cake Tool

DotnetDevKR.TailwindCSS

NuGet Version License: MPL 2.0

A .NET MSBuild integration package for TailwindCSS that automatically compiles your TailwindCSS files during the build process. This package includes cross-platform TailwindCSS standalone executables and provides seamless integration with .NET projects.

Features

  • 🚀 Automatic compilation during MSBuild process
  • 📦 No Node.js dependency - uses standalone TailwindCSS CLI
  • 🔧 MSBuild integration with customizable properties

Installation

From NuGet.org

Install the NuGet package in your .NET project:

dotnet add package DotnetDevKR.TailwindCSS

From GitHub Packages

You can also install the package from GitHub Packages:

  1. Add GitHub Packages as a NuGet source (one time setup):

    dotnet nuget add source https://nuget.pkg.github.com/dotnetdev-kr/index.json \
      --name github \
      --username YOUR_GITHUB_USERNAME \
      --password YOUR_GITHUB_PAT \
      --store-password-in-clear-text
    
  2. Install the package:

    dotnet add package DotnetDevKR.TailwindCSS
    

Note: You need a GitHub Personal Access Token (PAT) with read:packages scope to install from GitHub Packages.

Quick Start

Rebuilding when dotnet watch is not working, so If you use dotnet watch, hit Ctrl + R

  1. Install the package in your project
  2. Create a TailwindCSS input file (e.g., tailwind.css):
    @import "tailwindcss";
    
  3. Configure MSBuild properties in your .csproj file:
    <Target Name="Configure" BeforeTargets="RunTailwindCSSTask">
      <PropertyGroup>
        <InputFilename>$(ProjectDir)tailwind.css</InputFilename>
        <OutputFilename>wwwroot\css\app.css</OutputFilename>
        <IsMinify>false</IsMinify>
        <DebugMode>true</DebugMode>
      </PropertyGroup>
    </Target>
    
  4. Build your project - TailwindCSS will be compiled automatically!

Configuration

Configure the TailwindCSS compilation by setting these properties in your project file:

Property Description Default Required
InputFilename Path to the input TailwindCSS file - No
OutputFilename Path where the compiled CSS will be saved - ✅ Yes
IsMinify Enable CSS minification false No
DebugMode Generate source maps false No
ProjectDir Project directory for TailwindCSS context Current directory No

Example Configuration

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DotnetDevKR.TailwindCSS" Version="0.0.1" />
  </ItemGroup>

  <Target Name="Configure" BeforeTargets="RunTailwindCSSTask">
    <PropertyGroup>
      <InputFilename>$(ProjectDir)tailwind.css</InputFilename>
      <OutputFilename>wwwroot\css\app.css</OutputFilename>
      <IsMinify Condition="'$(Configuration)' == 'Release'">true</IsMinify>
      <DebugMode Condition="'$(Configuration)' == 'Debug'">true</DebugMode>
    </PropertyGroup>
  </Target>

</Project>

Development Workflow

For Development

  • Set DebugMode="true" to generate source maps
  • Set IsMinify="false" for readable CSS output

For Production

  • Set IsMinify="true" to reduce file size
  • Set DebugMode="false" to disable source maps

Example Projects

Check out the DotnetDevKR.TailwindCSS.WebTest folder for a complete Blazor WebAssembly example that demonstrates:

  • Basic TailwindCSS integration
  • MSBuild configuration
  • File structure organization

How It Works

  1. MSBuild Integration: The package registers a build task that runs before the main build
  2. Platform Detection: Automatically detects your OS and architecture
  3. TailwindCSS Execution: Runs the appropriate TailwindCSS standalone executable
  4. File Processing: Compiles your input CSS file and outputs the result

Versioning

This package follows a 4-part version scheme that directly maps to TailwindCSS versions:

{TailwindMajor}.{TailwindMinor}.{TailwindPatch}.{Revision}

Examples

Package Version TailwindCSS Version Revision
4.1.17.0 v4.1.17 0
4.1.17.1 v4.1.17 1
4.2.0.0 v4.2.0 0
  • First 3 parts: Directly correspond to the TailwindCSS version
  • 4th part (Revision): Increments for package-only fixes (without TailwindCSS version change)

This versioning makes it easy to identify which TailwindCSS version is included in the package at a glance.

Automatic TailwindCSS Version Updates

This package automatically stays up-to-date with the latest TailwindCSS releases:

  • 🤖 Automated Checks: Daily automated checks for new TailwindCSS versions
  • 📦 Auto-Publishing: Automatically builds and publishes updated NuGet packages
  • 🏷️ Version Format: {TailwindMajor}.{TailwindMinor}.{TailwindPatch}.{Revision} (e.g., 4.1.17.0)
  • 🔄 Seamless Updates: Simply update the NuGet package to get the latest TailwindCSS features

When a new TailwindCSS version is released, our GitHub Actions workflow:

  1. Detects the new version from NuGet registry
  2. Creates a new package version (e.g., 4.1.18.0)
  3. Downloads the latest TailwindCSS executables
  4. Builds and publishes to NuGet.org
  5. Creates a GitHub release with release notes

Requirements

  • .NET 6.0 or higher
  • Any platform supported by .NET (Windows, macOS, Linux)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE.md file for details.

Acknowledgments


Made with ❤️ by DotnetDevKR and Forum

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.18.1 88 12/12/2025
4.1.17.1 287 11/17/2025
4.1.17 281 11/17/2025
0.1.0 51 7/27/2025