Table of Contents

Interface IStyleFormatter

Namespace
AngleSharp
Assembly
AngleSharp.dll

Basic interface for CSS node serialization.

public interface IStyleFormatter
Extension Methods

Methods

BlockDeclarations(IEnumerable<IStyleFormattable>)

Creates the serialization of the declarations with the provided string representations.

string BlockDeclarations(IEnumerable<IStyleFormattable> declarations)

Parameters

declarations IEnumerable<IStyleFormattable>

The declarations to aggregate.

Returns

string

The serialization of the declarations.

BlockRules(IEnumerable<IStyleFormattable>)

Concats the given rules to create a block serialization.

string BlockRules(IEnumerable<IStyleFormattable> rules)

Parameters

rules IEnumerable<IStyleFormattable>

The rules to aggregate.

Returns

string

The serialization of the CSS rule block.

Comment(string)

Creates a serialization of a comment with the provided data.

string Comment(string data)

Parameters

data string

The data of the comment.

Returns

string

The serialization of the comment.

Declaration(string, string, bool)

Creates the serialization of a declaration with the given name, value and important flag.

string Declaration(string name, string value, bool important)

Parameters

name string

The name of the declaration.

value string

The value of the declaration.

important bool

The value of the important flag.

Returns

string

The serialization of the declaration.

Rule(string, string)

Converts the name and value of the provided rule to a simple rule.

string Rule(string name, string value)

Parameters

name string

The name of the simple rule.

value string

The value of the simple rule.

Returns

string

The serialization of the simple rule.

Rule(string, string, string)

Converts the name, prelude and rules of the provided rule to a composed rule.

string Rule(string name, string prelude, string rules)

Parameters

name string

The name of the nested rule.

prelude string

The optional prelude.

rules string

The serialization of the nested rules.

Returns

string

The serialization of the nested rule.

Sheet(IEnumerable<IStyleFormattable>)

Concats the given rules to create the stylesheet serialization.

string Sheet(IEnumerable<IStyleFormattable> rules)

Parameters

rules IEnumerable<IStyleFormattable>

The rules to aggregate.

Returns

string

The serialization of the sheet.