PlayNicely.Sass 1.4.2-beta-181

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-181                
NuGet\Install-Package PlayNicely.Sass -Version 1.4.2-beta-181                
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-181">
  <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-181                
#r "nuget: PlayNicely.Sass, 1.4.2-beta-181"                
#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-181&prerelease

// Install PlayNicely.Sass as a Cake Tool
#tool nuget:?package=PlayNicely.Sass&version=1.4.2-beta-181&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-191 68 10/4/2024
1.4.2-beta-181 68 9/28/2024
1.4.2-beta-171 62 9/27/2024
1.4.2-beta-167 73 9/26/2024
1.4.2-beta-165 71 9/26/2024
1.4.2-beta-163 65 9/26/2024
1.4.1 87 9/26/2024
1.4.1-beta-159 78 9/26/2024
1.4.0 132 9/14/2024
1.4.0-beta-155 70 9/25/2024
1.4.0-beta-153 71 9/25/2024
1.4.0-beta-132 88 9/14/2024
1.3.3-beta-125 82 9/1/2024
1.3.2 115 6/1/2024
1.3.2-beta-118 86 7/12/2024
1.3.2-beta-111 95 6/1/2024
1.3.1 105 6/1/2024
1.3.1-beta-94 97 5/31/2024
1.3.1-beta-104 92 6/1/2024
1.3.0 106 5/17/2024
1.3.0-beta-86 90 5/22/2024
1.3.0-beta-81 94 5/21/2024
1.3.0-beta-68 105 5/17/2024
1.3.0-beta-33 90 5/12/2024
1.3.0-beta-28 88 5/12/2024