CssDeclarationSyntax Class

Represents a declaration, such as color: red !important;.

public sealed class CssDeclarationSyntax : CssStatementSyntax

Remarks

CssDeclarationSyntax.Values holds the value without the whitespace and comments around it, which are trivia, and without the !important that ends it, which is CssDeclarationSyntax.Important.

Inheritance
CssStatementSyntax CssDeclarationSyntax

Properties

NameDescription
ColonToken
Important
IsCustomPropertyDetermines whether the declaration sets a custom property, whose name starts with two dashes.
IsImportantDetermines whether the declaration ends with !important.
NameGets the name of the property, with its escapes resolved, such as color or --main-color.
NameToken
SemicolonToken
Values

ColonToken

Syntax.g.cs
public SyntaxToken ColonToken { get; }

Property value

SyntaxToken

No documentation is available.

Important

Syntax.g.cs
public CssImportantSyntax? Important { get; }

Property value

CssImportantSyntax?

No documentation is available.

IsCustomProperty

CssDeclarationSyntax.cs

Determines whether the declaration sets a custom property, whose name starts with two dashes.

public bool IsCustomProperty { get; }

Property value

bool

Determines whether the declaration ends with !important.

public bool IsImportant { get; }

Property value

bool

Gets the name of the property, with its escapes resolved, such as color or --main-color.

public string Name { get; }

Property value

string

NameToken

Syntax.g.cs
public SyntaxToken NameToken { get; }

Property value

SyntaxToken

No documentation is available.

SemicolonToken

Syntax.g.cs
public SyntaxToken SemicolonToken { get; }

Property value

SyntaxToken

No documentation is available.

public SyntaxList<CssComponentValueSyntax> Values { get; }

No documentation is available.

Methods

NameDescription
Accept(CssSyntaxVisitor)
Accept<TResult>(CssSyntaxVisitor<TResult>)
GetValueText()Gets the text of the value as written, from its first token to its last, comments and line breaks included.
Update(SyntaxToken, SyntaxToken, SyntaxList<CssComponentValueSyntax>, CssImportantSyntax?, SyntaxToken)Returns this node with the given parts, or itself when nothing changed.
WithColonToken(SyntaxToken)Returns this node with colonToken in place of its CssDeclarationSyntax.ColonToken.
WithImportant(CssImportantSyntax?)Returns this node with important in place of its CssDeclarationSyntax.Important.
WithNameToken(SyntaxToken)Returns this node with nameToken in place of its CssDeclarationSyntax.NameToken.
WithSemicolonToken(SyntaxToken)Returns this node with semicolonToken in place of its CssDeclarationSyntax.SemicolonToken.
WithValues(SyntaxList<CssComponentValueSyntax>)Returns this node with values in place of its CssDeclarationSyntax.Values.

Accept overloads

Accept(CssSyntaxVisitor)

Syntax.g.cs
public override void Accept(CssSyntaxVisitor visitor)
Parameters
visitor CssSyntaxVisitor

No documentation is available.

Accept<TResult>(CssSyntaxVisitor<TResult>)

Syntax.g.cs
public override TResult? Accept<TResult>(CssSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor CssSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Gets the text of the value as written, from its first token to its last, comments and line breaks included.

public string GetValueText()

Returns

string

Update(SyntaxToken, SyntaxToken, SyntaxList<CssComponentValueSyntax>, CssImportantSyntax?, SyntaxToken)

Syntax.g.cs

Returns this node with the given parts, or itself when nothing changed.

public CssDeclarationSyntax Update(SyntaxToken nameToken, SyntaxToken colonToken, SyntaxList<CssComponentValueSyntax> values, CssImportantSyntax? important, SyntaxToken semicolonToken)

WithColonToken(SyntaxToken)

Syntax.g.cs

Returns this node with colonToken in place of its CssDeclarationSyntax.ColonToken.

public CssDeclarationSyntax WithColonToken(SyntaxToken colonToken)

Parameters

colonToken SyntaxToken

Returns

CssDeclarationSyntax

WithImportant(CssImportantSyntax?)

Syntax.g.cs

Returns this node with important in place of its CssDeclarationSyntax.Important.

public CssDeclarationSyntax WithImportant(CssImportantSyntax? important)

Parameters

important CssImportantSyntax?

Returns

CssDeclarationSyntax

WithNameToken(SyntaxToken)

Syntax.g.cs

Returns this node with nameToken in place of its CssDeclarationSyntax.NameToken.

public CssDeclarationSyntax WithNameToken(SyntaxToken nameToken)

Parameters

nameToken SyntaxToken

Returns

CssDeclarationSyntax

WithSemicolonToken(SyntaxToken)

Syntax.g.cs

Returns this node with semicolonToken in place of its CssDeclarationSyntax.SemicolonToken.

public CssDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken)

Parameters

semicolonToken SyntaxToken

Returns

CssDeclarationSyntax

WithValues(SyntaxList<CssComponentValueSyntax>)

Syntax.g.cs

Returns this node with values in place of its CssDeclarationSyntax.Values.