Stablev1.5.0190M downloads

A full CSS parser and CSSOM provider to include support for stylesheets, inline styles, and style computations within AngleSharp.

$ dotnet add package AngleSharp.Css

AngleSharp.Css Documentation

We have more detailed information regarding the following subjects:

General

Tutorials

If you are new to AngleSharp.Css, this order gives a practical ramp-up:

  1. Getting Started for setup and first working code.
  2. Examples for copy-paste recipes.
  3. API Documentation for deeper understanding of the CSSOM model.
  4. CSSOM and Core Interfaces once you need a deeper model understanding.
  5. Supported At-Rules and Supported Declarations when checking implementation coverage and constraints.
  6. Value Model and Render Tree Examples for style computation workflows.
  7. Extensibility and Provided Services for custom integrations, and the Painting API for drawing paint() images with your own painters or scripting engine.
  8. FAQ for common pitfalls and output customization.

What You Can Do With AngleSharp.Css

Typical use cases include:

  • Parsing and validating CSS snippets from editors, CMS content, or user input.
  • Inspecting and rewriting style declarations programmatically.
  • Loading real HTML pages and accessing linked stylesheets through the DOM.
  • Computing final values (e.g., color, width, display) for elements.
  • Building tooling: linters, migration scripts, design token extractors, or static analyzers.