Abstractions.Sass.CIBuild 1.1.75

There is a newer version of this package available.
See the version list below for details.
dotnet add package Abstractions.Sass.CIBuild --version 1.1.75
                    
NuGet\Install-Package Abstractions.Sass.CIBuild -Version 1.1.75
                    
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="Abstractions.Sass.CIBuild" Version="1.1.75">
  <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="Abstractions.Sass.CIBuild" Version="1.1.75" />
                    
Directory.Packages.props
<PackageReference Include="Abstractions.Sass.CIBuild">
  <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 Abstractions.Sass.CIBuild --version 1.1.75
                    
#r "nuget: Abstractions.Sass.CIBuild, 1.1.75"
                    
#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 Abstractions.Sass.CIBuild@1.1.75
                    
#: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=Abstractions.Sass.CIBuild&version=1.1.75
                    
Install as a Cake Addin
#tool nuget:?package=Abstractions.Sass.CIBuild&version=1.1.75
                    
Install as a Cake Tool

Sass Compiler

Based on and heavily influenced by the awesome WebCompiler by Mads Christensen. Compiles Sass/Scss files into CSS with cross-platform build support

What's new in the latest version

  • The package is added with PrivateAssets="all". Abstractions.Sass.CIBuild is a development dependency, so a project that is itself packed as a NuGet package no longer passes it on. A reference that was added before does not change: add PrivateAssets="all" to it yourself.
  • An agent skill for AI coding agents, such as Claude Code and GitHub Copilot, that tells them how the compiler works. The build copies it into the .claude or .agents folder that the repository already has, and nowhere else (see Agent skill below).
  • "Enable compile on build" adds the package without a dialog, and says what it did in the Output window.
  • The package is about 2 MB smaller.

Choosing the runtime

The compiler can use DartSassHost in addition to LibSassHost, which is the default. Use DartSassHost in order to make use of newer SASS/SCSS features that are not supported by the now deprecated libsass.

To switch to dart-sass set the runtime parameter, either per file in sassconfig.json:

[
  {
    "outputFile": "wwwroot/site.css",
    "inputFile": "Styles/site.scss",
    "runtime": "LibSass"
  },
  {
    "outputFile": "wwwroot/someotherfile.css",
    "inputFile": "Styles/someotherfile.scss",
    "runtime": "DartSass"
  }
]

or globally in sassconfig.json.defaults:

{
  "sourceMap": false,
  "loadPaths": [],
  "style": "Expanded",
  "precision": 10,
  "lineFeed": "CrLf",
  "includeInProject": true,
  "runtime": "DartSass"
}

Key differences

  • Works with Visual Studio 2022 and 2026
  • Only works with Sass/Scss files
  • No dependency on node; LibSassHost, or DartSassHost is used instead
  • CI builds works on Linux build hosts as well as Windows
  • Configuration files are simplified to reflect sass-only compilation
  • Errors point to the correct source file even when they occurred in an import

Visual Studio extension

A Visual Studio extension that compiles Sass/Scss files. Works with Visual Studio 2022 and 2026, and supports CI/CD with cross-platform build support.

Get the extension on the Visual Studio Marketplace: Abstractions Sass Compiler, or in Visual Studio under Extensions › Manage Extensions.

Features

  • Compilation of Sass/Scss files
  • Saving a source file triggers re-compilation automatically
  • Specify compiler options for each individual file
  • Error List integration
  • MSBuild support for CI scenarios
  • Shows a watermark when opening a generated file
  • Shortcut to compile all specified files in solution

Getting started

Right-click a .scss or .sass file in Solution Explorer and choose Sass Compiler › Compile file (Shift+Alt+Q). The file is added to sassconfig.json in the root of the project, which is created the first time, with sassconfig.json.defaults next to it, and it is compiled. For a file that is compiled already, the command is Re-compile file, and Remove from compilation... takes the file out of sassconfig.json again.

Right-click sassconfig.json or the project for the commands that work on all of its files, in the same Sass Compiler menu:

  • Re-compile all files compiles every file in sassconfig.json.
  • Delete all output files... deletes the CSS files, after asking.
  • Enable compile on build compiles them when the project builds (see below).

Compile on save

Any time a .scss or .sass file or one of the configuration files (sassconfig.json or sassconfig.json.defaults) is saved, the compiler runs automatically to produce the compiled output file.

Compile on build / CI support

You can compile as part of the build, also on a build server: right-click sassconfig.json or the project and choose Sass Compiler › Enable compile on build. This adds the NuGet package Abstractions.Sass.CIBuild to the project, and Disable compile on build removes it again. The status bar shows the progress, and the Abstractions Sass Compiler pane of the Output window says what was done.

A PackageReference will be added to the project, with PrivateAssets="all", so that a project that is itself packed as a NuGet package does not pass it on. A reference that was added before the package set this does not have it: add PrivateAssets="all" to it yourself. The NuGet package contains an MSBuild task that runs the same compilers on the sassconfig.json file in the root of the project. The task runs before every build and cleans the output files on Clean. To skip it, for example in one configuration, set the property RunSassCompiler to False:

<PropertyGroup>
  <RunSassCompiler>False</RunSassCompiler>
</PropertyGroup>

The package runs in the 64-bit MSBuild: dotnet build, the build in Visual Studio, and MSBuild\Current\Bin\amd64\MSBuild.exe. It does not run in the 32-bit MSBuild\Current\Bin\MSBuild.exe, as it only has 64-bit native libraries.

Agent skill

The package brings a skill for AI coding agents, such as Claude Code and GitHub Copilot, that tells them how the compiler works: sassconfig.json and its options, that LibSass, the default, has no @use or sass:math, how urls are written, and how the build reports an error.

When the repository already uses an agent, the build copies the skill into it: into skills/abstractions-sass-compiler in the nearest .claude or .agents folder (both, when both are there), looking in the folder of the project and then in the folders above it, up to the root of the repository. Outside a repository, only the folder of the project is looked in. A repository without such a folder gets nothing, and the folder of the user (~/.claude) is never written to. The skill is only written when it changed, so it changes in the repository when an update of the package changes it. Commit it, or ignore it, as you do with the other skills of the repository, and do not edit it: the next update overwrites it.

To turn it off:

<PropertyGroup>
  <SassAgentSkills>False</SassAgentSkills>
</PropertyGroup>

To choose the folders yourself, set HerreruudAgentSkills to claude (.claude/skills), agents (.agents/skills) or all, in the folder of the project or the folder that HerreruudAgentSkillsRoot names. The Herreruud.Framework packages read the same properties, so one setting copies the skills of all of them.

Compile all

Build › Re-compile all files in solution (Shift+Alt+Y), also on the context menu of the solution, compiles the files of every sassconfig.json in the solution.

Error list

When a file does not compile, the Error List shows the error with its file, line and column, also when it is in an imported file, with Abstractions Sass Compiler as its source. Double-click it to go to it.

Source maps

Source maps are supported when enabled either in sassconfig.json or sassconfig.json.defaults.

Relative urls

By default, a url() is written to the CSS as it is in the Sass, as other Sass compilers do. A relative url is then relative to the CSS file, so write it from where the CSS ends up, or use a path that starts with /:

// Styles/site.scss, compiled to wwwroot/css/site.css
.logo { background: url(../images/logo.png); }   // wwwroot/images/logo.png
.hero { background: url(/images/hero.jpg); }      // from the root of the site

Set rewriteUrls to true, per file in sassconfig.json or for every file in sassconfig.json.defaults, to write relative urls from the Sass file instead. The compiler then rewrites them to be relative to the CSS file:

[
  {
    "inputFile": "wwwroot/styles/site.scss",
    "outputFile": "wwwroot/css/site.css",
    "rewriteUrls": true
  }
]

With that, url(images/logo.png) in wwwroot/styles/site.scss becomes url(../styles/images/logo.png) in the CSS. The query and fragment of a url are kept, and urls that start with / or #, or have a scheme (data:, https:), are never changed. The compiled CSS does not say which file a url came from, so a url in an imported partial is read as relative to the main Sass file, not to the partial.

Libraries such as Font Awesome and Bootstrap Icons write their urls relative to the CSS, so leave rewriteUrls off for them.

sassconfig.json

The extension adds a sassconfig.json file at the root of the project which is used to configure the compilation.

Here's an example of what that file looks like:

[
  {
    "outputFile": "wwwroot/site.css",
    "inputFile": "Styles/site.scss"
  },
  {
    "outputFile": "wwwroot/someotherfile.css",
    "inputFile": "Styles/someotherfile.scss",
    "sourceMap": "true",
    "style": "Compact"
  }
]

Default values for sassconfig.json can be found in the sassconfig.json.defaults file in the same location.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
2.0.4 14 11/20/2026
2.0.3 21 11/20/2026
2.0.2 99 11/16/2026
2.0.1 94 11/15/2026
2.0.0 141 11/14/2026
1.1.75 97 11/14/2026
1.1.74 97 11/13/2026
1.1.72 42,517 10/1/2025
1.1.71 432 9/30/2025
1.1.67 5,519 3/5/2025
1.1.65 3,810 1/21/2025
1.1.64 630 1/21/2025
1.1.63 623 1/21/2025
1.1.62 650 1/21/2025
1.1.60 981 1/17/2025
1.1.59 3,826 11/13/2024
1.1.58 1,133 10/21/2024
1.1.57 782 10/19/2024
1.1.56 718 10/18/2024
1.1.55 587 10/18/2024
Loading failed

Changes since 1.1.74:
- Abstractions.Sass.CIBuild is a development dependency: NuGet adds it with PrivateAssets="all", so a project that is itself packed no longer passes it on. Add PrivateAssets="all" to a reference that was added before.
- New: an agent skill for AI coding agents (Claude Code, GitHub Copilot) that describes sassconfig.json, LibSass and DartSass, urls and errors. The build copies it into the nearest .claude or .agents folder of the repository, and only where one exists. SassAgentSkills=False turns it off; HerreruudAgentSkills chooses the folders instead.
- Abstractions.Sass.CIBuild is about 2 MB smaller (System.Linq.Async removed).
- Visual Studio: "Enable compile on build" adds the package without a dialog, and reports in the Output window.