CssParserToken Struct
The CSSToken typedef: (DOMString or CSSStyleValue or CSSParserValue) (https://wicg.github.io/css-parser-api/#typedefdef-csstoken), a component value (https://drafts.csswg.org/css-syntax-3/#component-value) of the results of the CSS Parser API. The parser represents an ident token as a CssKeywordValue, a number, a percentage or a dimension token whose unit is a CSS unit as a CssUnitValue, a function as a CssParserFunction, a simple block as a CssParserBlock, a whitespace token as " ", and the other tokens as their text (e.g. ",", "#fff", "\"text\"", "10foo").
public readonly struct CssParserToken : IEquatable<CssParserToken>- Implements
Properties
| Name | Description |
|---|---|
| ParserValue | Gets the token as a CssParserValue (a function or a block), or null. |
| StringValue | Gets the token as a string, or null when it is an object. |
| StyleValue | Gets the token as a CssStyleValue, or null. |
| Value | Gets the value: a String, a CssStyleValue or a CssParserValue. |
ParserValue
CssParserObjects.csGets the token as a CssParserValue (a function or a block), or null.
public CssParserValue? ParserValue { get; }Property value
StringValue
CssParserObjects.csStyleValue
CssParserObjects.csValue
CssParserObjects.csGets the value: a String, a CssStyleValue or a CssParserValue.
public object Value { get; }Property value
Methods
| Name | Description |
|---|---|
| Equals(CssParserToken) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromCssParserValue(CssParserValue) | Creates a CssParserToken from a CssParserValue. |
| FromCssStyleValue(CssStyleValue) | Creates a CssParserToken from a CssStyleValue. |
| FromString(string) | Creates a CssParserToken from a string. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the serialization of the token. |
Equals overloads
Equals(CssParserToken)
CssParserObjects.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(CssParserToken other)Parameters
otherCssParserToken- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
CssParserObjects.csFromCssParserValue(CssParserValue)
CssParserObjects.csCreates a CssParserToken from a CssParserValue.
public static CssParserToken FromCssParserValue(CssParserValue value)FromCssStyleValue(CssStyleValue)
CssParserObjects.csCreates a CssParserToken from a CssStyleValue.
public static CssParserToken FromCssStyleValue(CssStyleValue value)FromString(string)
CssParserObjects.csCreates a CssParserToken from a string.
public static CssParserToken FromString(string value)GetHashCode()
CssParserObjects.csToString()
CssParserObjects.csOperators
| Name | Description |
|---|---|
| operator ==(CssParserToken, CssParserToken) | Determines whether two CssParserToken values are equal. |
| implicit operator CssParserToken(CssParserValue) | Converts a CssParserValue to a CssParserToken. |
| implicit operator CssParserToken(CssStyleValue) | Converts a CssStyleValue to a CssParserToken. |
| implicit operator CssParserToken(string) | Converts a string to a CssParserToken. |
| operator !=(CssParserToken, CssParserToken) | Determines whether two CssParserToken values are not equal. |
operator ==(CssParserToken, CssParserToken)
CssParserObjects.csDetermines whether two CssParserToken values are equal.
public static bool operator ==(CssParserToken left, CssParserToken right)op_Implicit overloads
implicit operator CssParserToken(CssParserValue)
CssParserObjects.csConverts a CssParserValue to a CssParserToken.
public static implicit operator CssParserToken(CssParserValue value)implicit operator CssParserToken(CssStyleValue)
CssParserObjects.csConverts a CssStyleValue to a CssParserToken.
public static implicit operator CssParserToken(CssStyleValue value)implicit operator CssParserToken(string)
CssParserObjects.csConverts a string to a CssParserToken.
public static implicit operator CssParserToken(string value)operator !=(CssParserToken, CssParserToken)
CssParserObjects.csDetermines whether two CssParserToken values are not equal.
public static bool operator !=(CssParserToken left, CssParserToken right)