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
<PackageReference Include="CodeBrix.StyleSheetParse.MitLicenseForever" Version="1.0.102" />
<PackageVersion Include="CodeBrix.StyleSheetParse.MitLicenseForever" Version="1.0.102" />
<PackageReference Include="CodeBrix.StyleSheetParse.MitLicenseForever" />
paket add CodeBrix.StyleSheetParse.MitLicenseForever --version 1.0.102
#r "nuget: CodeBrix.StyleSheetParse.MitLicenseForever, 1.0.102"
#:package CodeBrix.StyleSheetParse.MitLicenseForever@1.0.102
#addin nuget:?package=CodeBrix.StyleSheetParse.MitLicenseForever&version=1.0.102
#tool nuget:?package=CodeBrix.StyleSheetParse.MitLicenseForever&version=1.0.102
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 | Versions 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. |
-
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 |