CssParserDeclaration Class
A declaration (https://wicg.github.io/css-parser-api/#cssparserdeclaration, https://drafts.csswg.org/css-syntax-3/#declaration): a name and a value, e.g. color: red.
public sealed class CssParserDeclaration : CssParserRule- Inheritance
CssParserRuleCssParserDeclaration
Constructors
| Name | Description |
|---|---|
| CssParserDeclaration(string, IEnumerable<CssParserToken>?) | Creates a declaration (https://wicg.github.io/css-parser-api/#dom-cssparserdeclaration-cssparserdeclaration). |
CssParserDeclaration(string, IEnumerable<CssParserToken>?)
CssParserObjects.csCreates a declaration (https://wicg.github.io/css-parser-api/#dom-cssparserdeclaration-cssparserdeclaration).
public CssParserDeclaration(string name, IEnumerable<CssParserToken>? body = null)Parameters
namestring- The name of the declaration (e.g. a property name).
bodyIEnumerable<CssParserToken>?- The component values of the value. The IDL of the draft declares a sequence of rules; as the
CssParserDeclaration.Bodyattribute, it is a list of component values.
See also
Properties
| Name | Description |
|---|---|
| Body | Gets the component values of the value, without the leading and trailing whitespace and without !important (https://drafts.csswg.org/css-syntax-3/#consume-declaration). |
| Important | Gets a value indicating whether the value ended with !important (the important flag of CSS Syntax). The draft has no attribute for it: the scripts see it in the serialization. |
| Name | Gets the name of the declaration. |
Gets the component values of the value, without the leading and trailing whitespace and without !important (https://drafts.csswg.org/css-syntax-3/#consume-declaration).
public IReadOnlyList<CssParserToken> Body { get; }Important
CssParserObjects.csGets the name of the declaration.
public string Name { get; }