Cascadium.Compiler
0.9.2
dotnet add package Cascadium.Compiler --version 0.9.2
NuGet\Install-Package Cascadium.Compiler -Version 0.9.2
<PackageReference Include="Cascadium.Compiler" Version="0.9.2" />
paket add Cascadium.Compiler --version 0.9.2
#r "nuget: Cascadium.Compiler, 0.9.2"
// 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 | Versions 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. |
-
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.