AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.2.6" />

 CssParser

public class CssParser : IParser
The CSS parser. See http://dev.w3.org/csswg/css-syntax/#parsing for more details.
public bool IsAsync { get; }

Gets if the parser has been started asynchronously.

public bool IsQuirksMode { get; set; }

Gets or sets if the quirks-mode is activated.

public CSSStyleSheet Result { get; }

Gets the resulting stylesheet of the parsing.

The event will be fired once an error has been detected.

public CssParser(string source)

Creates a new CSS parser instance with a new stylesheet based on the given source.

public CssParser(Stream stream)

Creates a new CSS parser instance with an new stylesheet based on the given stream.

public CssParser(CSSStyleSheet stylesheet, string source)

Creates a new CSS parser instance with the specified stylesheet based on the given source.

public CssParser(CSSStyleSheet stylesheet, Stream stream)

Creates a new CSS parser instance with the specified stylesheet based on the given stream.

public static CSSStyleDeclaration ParseDeclarations(string declarations, bool quirksMode = false)

Takes a string and transforms it into CSS declarations.

public static CSSRule ParseRule(string rule, bool quirksMode = false)

Takes a string and transforms it into a CSS rule.

public static Selector ParseSelector(string selector, bool quirksMode = false)

Takes a string and transforms it into a selector object.

public static CSSStyleSheet ParseStyleSheet(string stylesheet, bool quirksMode = false)

Takes a string and transforms it into a CSS stylesheet.

public static CSSValue ParseValue(string source, bool quirksMode = false)

Takes a string and transforms it into a CSS value.

public void Parse()

Parses the given source code.

public Task ParseAsync()

Parses the given source asynchronously and creates the stylesheet. WARNING: This method is not yet implemented.