CodeBrix.StyleSheetParse.MitLicenseForever 1.0.102

dotnet add package CodeBrix.StyleSheetParse.MitLicenseForever --version 1.0.102
                    
NuGet\Install-Package CodeBrix.StyleSheetParse.MitLicenseForever -Version 1.0.102
                    
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="CodeBrix.StyleSheetParse.MitLicenseForever" Version="1.0.102" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeBrix.StyleSheetParse.MitLicenseForever" Version="1.0.102" />
                    
Directory.Packages.props
<PackageReference Include="CodeBrix.StyleSheetParse.MitLicenseForever" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeBrix.StyleSheetParse.MitLicenseForever --version 1.0.102
                    
#r "nuget: CodeBrix.StyleSheetParse.MitLicenseForever, 1.0.102"
                    
#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.
#:package CodeBrix.StyleSheetParse.MitLicenseForever@1.0.102
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeBrix.StyleSheetParse.MitLicenseForever&version=1.0.102
                    
Install as a Cake Addin
#tool nuget:?package=CodeBrix.StyleSheetParse.MitLicenseForever&version=1.0.102
                    
Install as a Cake Tool

CodeBrix.StyleSheetParse

A fully managed, cross-platform CSS stylesheet parsing library for .NET. CodeBrix.StyleSheetParse has no dependencies other than .NET, and is provided as a .NET 10 library and associated CodeBrix.StyleSheetParse.MitLicenseForever NuGet package.

CodeBrix.StyleSheetParse supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.

CodeBrix.StyleSheetParse is a fork of the code of the open source ExCSS library - see below for licensing details.

CodeBrix.StyleSheetParse supports:

  • CSS stylesheet parsing from strings and streams
  • Async parsing with cancellation support
  • CSS selector parsing and specificity calculation
  • Style rule, media query, and at-rule modeling
  • @keyframes, @font-face, @supports, @container, @page, @import rules
  • Style declaration reading and manipulation
  • CSS serialization (converting parsed stylesheets back to CSS text)
  • Configurable parser tolerance (unknown rules, invalid selectors, comments, etc.)
  • Many more...

Sample Code

Parse a CSS Stylesheet

using CodeBrix.StyleSheetParse;

var parser = new StylesheetParser();
var stylesheet = parser.Parse("h1 { color: red; font-size: 24px; }");

foreach (var rule in stylesheet.StyleRules)
{
    Console.WriteLine($"Selector: {rule.SelectorText}");
    Console.WriteLine($"Color: {rule.Style.Color}");
}

Parse a CSS Selector and Check Specificity

using CodeBrix.StyleSheetParse;

var parser = new StylesheetParser();
var selector = parser.ParseSelector("div.highlight > span#title");

Console.WriteLine($"Selector: {selector.Text}");
Console.WriteLine($"Specificity: {selector.Specificity}");

Serialize a Stylesheet Back to CSS

using CodeBrix.StyleSheetParse;

var parser = new StylesheetParser();
var stylesheet = parser.Parse("h1 { color: red; } @media screen { p { font-size: 14px; } }");

string css = stylesheet.ToCss();
Console.WriteLine(css);

Note that additional sample code and usage examples are available in the CodeBrix.StyleSheetParse.Tests project.

License

The project is licensed under the MIT License. see: https://en.wikipedia.org/wiki/MIT_License

All code originating from ExCSS was included as allowed by the MIT License permissible open source software license - as of ExCSS version 4.3.1. This project (CodeBrix.StyleSheetParse) complies with all provisions of the source code license of ExCSS v4.3.1 (MIT License).

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CodeBrix.StyleSheetParse.MitLicenseForever:

Package Downloads
CodeBrix.SvgParse.MsplLicenseForever

A renderer-agnostic SVG document object model (DOM) library for .NET. Provides comprehensive SVG parsing, element modeling, styling, and serialization capabilities. Supports loading SVG documents from files, streams, strings, and XmlReaders, and provides a rich object model for querying and manipulating SVG elements.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.102 100 4/14/2026