CssDeclarationSyntax Class
Represents a declaration, such as color: red !important;.
public sealed class CssDeclarationSyntax : CssStatementSyntaxRemarks
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
CssStatementSyntaxCssDeclarationSyntax
Properties
| Name | Description |
|---|---|
| ColonToken | |
| Important | |
| IsCustomProperty | Determines whether the declaration sets a custom property, whose name starts with two dashes. |
| IsImportant | Determines whether the declaration ends with !important. |
| Name | Gets the name of the property, with its escapes resolved, such as color or --main-color. |
| NameToken | |
| SemicolonToken | |
| Values |
ColonToken
Syntax.g.csImportant
Syntax.g.csIsCustomProperty
CssDeclarationSyntax.csIsImportant
CssDeclarationSyntax.csNameToken
Syntax.g.csSemicolonToken
Syntax.g.csValues
Syntax.g.cspublic SyntaxList<CssComponentValueSyntax> Values { get; }Property value
No documentation is available.
Methods
| Name | Description |
|---|---|
| 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.cspublic override void Accept(CssSyntaxVisitor visitor)Parameters
visitorCssSyntaxVisitor
No documentation is available.
Accept<TResult>(CssSyntaxVisitor<TResult>)
Syntax.g.cspublic override TResult? Accept<TResult>(CssSyntaxVisitor<TResult> visitor)No documentation is available.
GetValueText()
CssDeclarationSyntax.csUpdate(SyntaxToken, SyntaxToken, SyntaxList<CssComponentValueSyntax>, CssImportantSyntax?, SyntaxToken)
Syntax.g.csReturns 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)Parameters
nameTokenSyntaxTokencolonTokenSyntaxTokenvaluesSyntaxList<CssComponentValueSyntax>importantCssImportantSyntax?semicolonTokenSyntaxToken
Returns
WithColonToken(SyntaxToken)
Syntax.g.csReturns this node with colonToken in place of its CssDeclarationSyntax.ColonToken.
public CssDeclarationSyntax WithColonToken(SyntaxToken colonToken)WithImportant(CssImportantSyntax?)
Syntax.g.csReturns this node with important in place of its CssDeclarationSyntax.Important.
public CssDeclarationSyntax WithImportant(CssImportantSyntax? important)WithNameToken(SyntaxToken)
Syntax.g.csReturns this node with nameToken in place of its CssDeclarationSyntax.NameToken.
public CssDeclarationSyntax WithNameToken(SyntaxToken nameToken)WithSemicolonToken(SyntaxToken)
Syntax.g.csReturns this node with semicolonToken in place of its CssDeclarationSyntax.SemicolonToken.
public CssDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken)WithValues(SyntaxList<CssComponentValueSyntax>)
Syntax.g.csReturns this node with values in place of its CssDeclarationSyntax.Values.
public CssDeclarationSyntax WithValues(SyntaxList<CssComponentValueSyntax> values)