Cascadium.Compiler 0.9.2

dotnet add package Cascadium.Compiler --version 0.9.2                
NuGet\Install-Package Cascadium.Compiler -Version 0.9.2                
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="Cascadium.Compiler" Version="0.9.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cascadium.Compiler --version 0.9.2                
#r "nuget: Cascadium.Compiler, 0.9.2"                
#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 Cascadium.Compiler as a Cake Addin
#addin nuget:?package=Cascadium.Compiler&version=0.9.2

// Install Cascadium.Compiler as a Cake Tool
#tool nuget:?package=Cascadium.Compiler&version=0.9.2                

Cascadium

Cascadium is an lightweight pre-processor for the CSS styling language.

This small module can compile CSS with the following features into a legacy CSS file that is more compatible with most browsers. It is written in C#, built to run in any operating system without .NET installed. Also, it's source code is open-source.

Cascadium, unlike other CSS preprocessors, tends to be an extension of the CSS language and not another language. It has some developer-specific quirks, but all of them are aimed at still being "CSS".

Main features:

  • Convert nested CSS into plain CSS
  • Single line comments
  • Minify, compress and merge CSS files
  • Custom property converters
  • Media query rewriters

Getting started

You can use the library in your C# project or use the cross-platform tool compatible with absolutely any type of project.

To use the library in your code, you can start by adding the reference to Cascadium:

dotnet add package Cascadium.Compiler

And use as the example below:

static void Main(string[] args)
{
    string xcss = """
        div {
            color: red;

            > span {
                color: blue;
                font-weight: 500;
            }
        }
        """;

    var stylesheet = CascadiumCompiler.Parse(xcss);
    var css = stylesheet.Export();

    Console.WriteLine(css);
}

And get the result:

div{color:red}div>span{color:blue;font-weight:500}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.0

    • 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
0.9.2 104 11/7/2024
0.9.0 166 9/14/2024
0.6.1 130 8/22/2024
0.6.0 115 6/3/2024
0.4.0 133 4/10/2024
0.2.0 143 1/25/2024
0.1.2 256 11/2/2023
0.1.0 138 10/19/2023