LibSassBuilder-Tool 1.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global LibSassBuilder-Tool --version 1.6.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local LibSassBuilder-Tool --version 1.6.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=LibSassBuilder-Tool&version=1.6.0                
nuke :add-package LibSassBuilder-Tool --version 1.6.0                

LibSassBuilder

Inspired by Delegate.SassBuilder and LibSassHost

Build NuGet Package .NET Global Tool
Build Nuget .NET Tool

LibSassBuilder

Nuget Package

LibSassBuilder NuGet package adds a build task to compile Sass files to .css. It's compatible with both MSBuild (VS) and dotnet build.

No configuration is required, it will compile the files implicitly on project build.

Optionally provide arguments (see Options below):

<PropertyGroup>
  
  <LibSassOutputStyle>compressed</LibSassOutputStyle>
  <LibSassOutputStyle Condition="'$(Configuration)' == 'Debug'">expanded</LibSassOutputStyle>
  
  <LibSassOutputLevel>verbose</LibSassOutputLevel>
  
  <LibSassMessageLevel>High</LibSassMessageLevel>
</PropertyGroup>

Or take control of what files to process

<PropertyGroup>
  
  <EnableDefaultSassItems>false</EnableDefaultSassItems>  
</PropertyGroup>

<ItemGroup>
  
  <SassFile Include="Vendor/**/*.scss" > 
  <SassFile Include="Styles/**/*.scss" Exclude="Styles/unused/**" />
</ItemGroup>

Or ignore all previous options (except for LibSassMessageLevel) and determine the arguements to the tool yourself

<PropertyGroup>
  
  <LibSassBuilderArgs>directory "$(MSBuildProjectDirectory)"</LibSassBuilderArgs>
  
  <LibSassMessageLevel>High</LibSassMessageLevel>
</PropertyGroup>

.NET Global Tool

Install:

dotnet tool install --global LibSassBuilder-Tool

Use:

lsb [optional-path] [options]
lsb help
lsb help directory
lsb help files

Generic options

  -l, --level      Specify the level of output (silent, default, verbose)

 --outputstyle    Specify the style of output (compressed, condensed, nested, expanded)

Directory command (default)

Scans a directory recursively to generate .css files

  -e, --exclude    (Default: bin obj logs node_modules) Specify explicit directories to exclude. Overrides the default.

  --help           Display this help screen.

  --version        Display version information.

  value pos. 0     Directory in which to run. Defaults to current directory.

Example:

lsb directory
lsb directory sources/styles -e node_modules
lsb directory sources/styles -e node_modules -l verbose

Files in the following directories are excluded by default:

  • bin
  • obj
  • logs
  • node_modules

Files command (default)

Processes the files given on the commandline

  --help           Display this help screen.

  --version        Display version information.

  value pos. 0     File(s) to process.

Example:

lsb files sources/style/a.scss sources/vendor/b.scss
lsb files sources/style/a.scss sources/vendor/b.scss -l verbose

Requirements

LibSassBuilder can be installed on any project, however the underlying build tool requires .NET 5 installed on the machine.

Bypass Visual Studio fast up to date check

Visual studio does a quick check to find changed files. However if you edit the sass files, it does not see these as project changes. If you edit sass files a lot you can instruct Visual Studio to rely on msbuild, place the following property in your .csproj.

<PropertyGroup>
    <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>

Support

The support is largely dependant on LibSassHost

This tool contains the following supporting packages:

  • LibSassHost.Native.win-x64
  • LibSassHost.Native.linux-x64
  • LibSassHost.Native.osx-x64

Package as nuget package

./package.ps1 -PackageDir 'C:/LocalPackages' -Version '1.4.0.1'
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
3.0.0 8,183 11/11/2022
2.1.0 2,231 10/28/2022
2.0.2 1,442 7/28/2022
2.0.0 5,818 11/11/2021
1.6.3 1,180 6/20/2021
1.6.1 730 2/25/2021
1.6.0 442 2/23/2021
1.5.0 423 2/19/2021
1.4.0 1,005 1/5/2021