# HtmlCssSyntaxParser

Parses provider-independent CSS rules, declarations, and nested component values while retaining exact source.

Class 

`OfficeIMO.Html.Css`

**Namespace**

`OfficeIMO.Html.Css`

**Assembly**

`OfficeIMO.Html.Core`

**Source revision**

`56dd0d38e0b5` with working tree changes

**Source**

[HtmlCssSyntaxParser.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/Css/HtmlCssSyntaxParser.cs#L10)

**Modifiers**

static

Parses provider-independent CSS rules, declarations, and nested component values while retaining exact source.

## Inheritance

- object
- HtmlCssSyntaxParser

Filter members 

Show inherited

## Methods

`public static HtmlCssStyleBlock ParseStyleBlock(string source, HtmlCssSyntaxOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-parsestyleblock-string-officeimo-html-css-htmlcsssyntaxoptions-threading-cancellationtoken)

[HtmlCssSyntaxParser.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/Css/HtmlCssSyntaxParser.cs#L19)

Parses the contents of a style block, such as a style attribute, preserving duplicate and unknown declarations together with nested rules and invalid recovered source.

Parameters

**source string required**

**options OfficeIMO.Html.Css.HtmlCssSyntaxOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlCssStyleBlock`

`public static HtmlCssStyleSheet ParseStyleSheet(string source, HtmlCssSyntaxOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-parsestylesheet-string-officeimo-html-css-htmlcsssyntaxoptions-threading-cancellationtoken)

[HtmlCssSyntaxParser.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/Css/HtmlCssSyntaxParser.cs#L10)

Parses a stylesheet without validating selector or property grammars. Unknown at-rules, declarations, comments, whitespace, and recovered invalid source remain available.

Parameters

**source string required**

**options OfficeIMO.Html.Css.HtmlCssSyntaxOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlCssStyleSheet`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:5D7EBCC8CE593CBC91D7CE3936CDA01DCE92D8575053111AA8ACB1FCD1C85773 -->
