Blazorify.Sass 1.0.0-preview.251224173042

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

Blazorify.Sass

Lightweight C# wrapper around the Dart Sass compiler with first-class support for ASP.NET Core/Blazor. Ship SCSS with your app, compile to CSS at startup, and optionally watch for changes during development.

  • Bundles Dart Sass binaries for Windows, Linux, and macOS (x64)
  • Simple DI extensions to register SCSS inputs/outputs
  • File watching with debounce to recompile on change
  • Direct API for one-off string or file compilation

Install

dotnet add package Blazorify.Sass

Quick start (ASP.NET Core / Blazor)

Register your SCSS files and run the compiler during app startup:

using Blazorify.Sass;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddBlazorifySass(sass =>
{
	sass.Register(new SassFileRegistration
	{
		// Source SCSS (can import/using other .scss files)
		InputPath = "Styles/app.scss",
		// Where the compiled CSS should be written
		OutputPath = "wwwroot/css/app.css",
		Watch = builder.Environment.IsDevelopment(),
		Options = new SassCompilerOptions
		{
			IncludePaths = { "Styles", "Styles/partials" },
			Style = "compressed",
			SourceMap = false,
			Quiet = true
		}
	});
});

var app = builder.Build();

app.UseBlazorifySass(); // Compiles registered files (and starts watchers when enabled)

app.UseStaticFiles();
app.MapFallbackToFile("index.html");

app.Run();

Direct compilation

If you only need programmatic compilation, resolve SassCompiler and call it directly:

var logger = app.Services.GetRequiredService<ILogger<SassCompiler>>();
var compiler = new SassCompiler(logger);

var css = compiler.Compile("$primary: #0ea5e9; .button { color: $primary; }",
	new SassCompilerOptions { Style = "compressed" });

Console.WriteLine(css); // .button{color:#0ea5e9}

Options

SassCompilerOptions map closely to Dart Sass flags:

  • IncludePaths: Additional directories to resolve @import/@use.
  • Style: "expanded" (default) or "compressed".
  • SourceMap: true to emit source maps.
  • Quiet: Suppress warnings.

Set options per file via SassFileRegistration.Options or per call when using SassCompiler.

How it works

  • Dart Sass binaries are packed under runtimes/<RID>/native/dart-sass/.
  • UseBlazorifySass compiles each registered file and optionally starts a FileSystemWatcher to recompile on change (debounced at 300ms).
  • Logging uses ILogger—enable Debug level to see the exact CLI calls.

Notes

  • Target framework: net10.0.
  • Supported runtimes: win-x64, linux-x64, osx-x64 (additional RIDs would need binaries added to runtimes/).
  • For production, keep Watch = false and precompile during startup or at build time.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Blazorify.Sass:

Package Downloads
Blazorify.Bootstrap

A powerful Blazor component library that seamlessly integrates Bootstrap's responsive design and styling capabilities with the simplicity and efficiency of Blazor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.251224173042 147 12/24/2025
1.0.0-preview.251223204523 144 12/23/2025
1.0.0-preview.250702044952 166 7/2/2025