PlayNicely.Sass 1.4.2-beta-163

This is a prerelease version of PlayNicely.Sass.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package PlayNicely.Sass --version 1.4.2-beta-163                
NuGet\Install-Package PlayNicely.Sass -Version 1.4.2-beta-163                
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="PlayNicely.Sass" Version="1.4.2-beta-163">
  <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.
paket add PlayNicely.Sass --version 1.4.2-beta-163                
#r "nuget: PlayNicely.Sass, 1.4.2-beta-163"                
#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.
// Install PlayNicely.Sass as a Cake Addin
#addin nuget:?package=PlayNicely.Sass&version=1.4.2-beta-163&prerelease

// Install PlayNicely.Sass as a Cake Tool
#tool nuget:?package=PlayNicely.Sass&version=1.4.2-beta-163&prerelease                

Play Nicely - Sass

CSS is great but it does have its limitations, Sass is awesome but how do you get it to transpile in your .NET project? That is the question that Play Nicely is here to answer.

This package adds npx package execution support, for the JavaScript sass transpiler, into any .NET project.

Getting Started

We recommend initializing a node package, and adding sass as a dependency, before installing this package.

npm init
npm install --save-dev sass

Once the sass npm package is installed, add this package as a dependency to the project.

Install-Package PlayNicely.Sass

That's it, this package will include any *.scss or *.sass files for transpilation by default.

ℹ️ Partial files
Files prefixed with _ (underscore) will not be transpiled, per sass' partial rules.

Configuration

By default, any *.sass or *.scss file will be included as Sass items and transpiled.

<ItemGroup Condition="'$(SassIncludeDefaultItems)' != 'false'">
  <Sass Include="**/*.scss" Exclude="**/_*" />
  <Sass Include="**/*.sass" Exclude="**/_*" />
</ItemGroup>

The Sass items have the following metadata defaults.

<ItemDefinitionGroup>
  <Sass>
    <ProjectDir>%(RelativeDir)</ProjectDir>
    <FullProjectDir>%(RootDir)%(Directory)</FullProjectDir>
    <OutputFilename>%(Filename).css</OutputFilename>
    <MapFilename>%(OutputFilename).map</MapFilename>
    <PublishSource Condition="'$(SassPublishSource)' != 'true'">false</PublishSource>
    <PublishSource Condition="'$(SassPublishSource)' == 'true'">true</PublishSource>
  </Sass>  
</ItemDefinitionGroup>

The default configuration excludes any *.sass or *.scss source files and any generated *.css.map maps from the project's published output.

You can change this default behavior by changing properties, or individual item metadata.

Transpile *.sass or *.scss files by default

The property SassIncludeDefaultItems controls whether Sass items are included for transpilation by default. Its default value is unset, which is equivalent to true.

If this property is set to false, then you have to explicitly add Sass items to your project.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <SassIncludeDefaultItems>false</SassIncludeDefaultItems>
  </PropertyGroup>

  <ItemGroup>
    <Sass Include="path/to/your_file.scss" />
  </ItemGroup>

  
</Project>

Sass source and *.css.map files

By default the sass source files and any *.css.map files will be excluded from the published output. There are two ways to change this behaviour.

  1. Set the property SassPublishSource to true and all source files and maps will be published.
  2. For more fine grained control, you can update specific Sass items. Set their metadata PublishSource to true. Only those items with PublishSource == 'true' will have their source and maps published.
Publish all sass source files and maps

Set the SassPublishSource property to true to include all source files and maps in the published output. Simply add the property to the .NET project's PropertyGroup.

<PropertyGroup>
  <SassPublishSource>true</SassPublishSource>
</PropertyGroup>
Publish specific sass source items

To publish source and maps for individual sass files, update the item's metadata in the project file.

<ItemGroup>
  <Sass Update="path/to/your_file.scss">
    <PublishSource>true</PublishSource>
  </Sass>
</ItemGroup>
There are no supported framework assets in this 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
1.4.2-beta-181 29 9/28/2024
1.4.2-beta-171 30 9/27/2024
1.4.2-beta-167 41 9/26/2024
1.4.2-beta-165 35 9/26/2024
1.4.2-beta-163 33 9/26/2024
1.4.1 35 9/26/2024
1.4.1-beta-159 34 9/26/2024
1.4.0 117 9/14/2024
1.4.0-beta-155 26 9/25/2024
1.4.0-beta-153 32 9/25/2024
1.4.0-beta-132 76 9/14/2024
1.3.3-beta-125 79 9/1/2024
1.3.2 114 6/1/2024
1.3.2-beta-118 84 7/12/2024
1.3.2-beta-111 94 6/1/2024
1.3.1 104 6/1/2024
1.3.1-beta-94 96 5/31/2024
1.3.1-beta-104 91 6/1/2024
1.3.0 104 5/17/2024
1.3.0-beta-86 89 5/22/2024
1.3.0-beta-81 93 5/21/2024
1.3.0-beta-68 100 5/17/2024
1.3.0-beta-33 86 5/12/2024
1.3.0-beta-28 86 5/12/2024