Giter Site home page Giter Site logo

libsassbuilder's Introduction

Project replaced with DartSassBuilder

This project will be archived due to LibSass deprecation.

"LibSass is now deprecated—new projects should use Dart Sass instead." - https://sass-lang.com/libsass

LibSassBuilder

Inspired by Delegate.SassBuilder and LibSassHost

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

LibSassBuilder

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>
  <!-- outputstyle option -->
  <LibSassOutputStyle>compressed</LibSassOutputStyle>
  <LibSassOutputStyle Condition="'$(Configuration)' == 'Debug'">expanded</LibSassOutputStyle>
  <!-- level option -->
  <LibSassOutputLevel>verbose</LibSassOutputLevel>
  <!-- msbuild output level -->
  <LibSassMessageLevel>High</LibSassMessageLevel>
</PropertyGroup>
  • Or take control of what files to process

<PropertyGroup>
  <!-- take full-control -->
  <EnableDefaultSassItems>false</EnableDefaultSassItems>  
</PropertyGroup>

<ItemGroup>
  <!-- add files manually -->
  <SassFile Include="Vendor/**/*.scss" /> 
  <SassFile Include="Styles/**/*.scss" Exclude="Styles/unused/**" />
</ItemGroup>
  • Or ignore all previous options (except for <LibSassMessageLevel>) and determine the arguments to the tool yourself

<PropertyGroup>
  <!-- Take even more full-control -->
  <LibSassBuilderArgs>directory "$(MSBuildProjectDirectory)"</LibSassBuilderArgs>
  <!-- msbuild output level -->
  <LibSassMessageLevel>High</LibSassMessageLevel>
</PropertyGroup>

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, compact, 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 7 installed on the machine.

.NET 5 required with v1.x
.NET 6 required with v2.x

Support

The support is largely dependant on LibSassHost

This tool contains the following supporting packages:

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

Package as nuget package

./package.ps1 -PackageDir 'C:/LocalPackages' -Version '1.4.0.1'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.