SyntaxKind Enum

The kinds of node, token, and trivia a CSS tree is made of.

public enum SyntaxKind

Remarks

The tokens are those of the CSS tokenizer. Whitespace and comments are trivia rather than tokens, and the delimiters the grammars give a meaning to have a kind of their own; any other delimiter is a SyntaxKind.DelimToken. A keyword such as and or important stays an SyntaxKind.IdentToken, since CSS compares keywords without regard to case and a node already says what role each of its tokens plays.

Fields

NameValueDescription
None0
List1A sequence of children held in one slot. Shared by every language, and so fixed at 1.
IdentToken8000An identifier, such as color or --main-color.
FunctionToken8001An identifier followed by (, such as rgb(. Its value is the name without the parenthesis.
AtKeywordToken8002@ followed by an identifier, such as @media. Its value is the name without the @.
HashToken8003# followed by a name, such as #main or #fff. Its value is the name without the #.
StringToken8004A quoted string. Its value is the text between the quotes, with the escapes resolved.
BadStringToken8005A string that a line break ended before its closing quote.
UrlToken8006An unquoted url(...). Its value is the address, with the escapes resolved.
BadUrlToken8007An unquoted url(...) holding a character it cannot hold, such as a quote or whitespace in the middle.
NumberToken8008A number, such as 12 or -0.5e3.
PercentageToken8009A number followed by %.
DimensionToken8010A number followed by a unit, such as 10px.
CdoToken8011<!--, which the top level of a style sheet ignores.
CdcToken8012-->, which the top level of a style sheet ignores.
UnicodeRangeToken8013A U+0-7F range in the value of a unicode-range descriptor.
ColonToken8100
SemicolonToken8101
CommaToken8102
OpenBracketToken8103
CloseBracketToken8104
OpenParenToken8105
CloseParenToken8106
OpenBraceToken8107
CloseBraceToken8108
DelimToken8200A single character that is not part of any other token, and has no kind of its own.
DotToken8201., which starts a class selector.
AsteriskToken8202*, the universal selector.
AmpersandToken8203&, the nesting selector.
GreaterThanToken8204
LessThanToken8205
EqualsToken8206
PlusToken8207
MinusToken8208
TildeToken8209
BarToken8210|, which separates a namespace prefix from a name.
CaretToken8211
DollarToken8212
ExclamationToken8213!, which starts !important.
SlashToken8214
EndOfFileToken8400The end of the text. It holds the trivia after the last token.
WhitespaceTrivia8500Spaces and tabs.
EndOfLineTrivia8501A line break: \n, \r\n, \r, or a form feed.
MultiLineCommentTrivia8502A /* ... */ comment.
StyleSheet9000A whole style sheet.
StyleRule9001A style rule, such as a { color: red }, whose prelude is a selector list.
KeyframeRule9002A rule in a @keyframes block, such as from { opacity: 0 }.
QualifiedRule9003A qualified rule that is neither a style rule nor a keyframe rule, such as one in an unknown at-rule.
CharsetRule9010
ImportRule9011
NamespaceRule9012
MediaRule9013
SupportsRule9014
ContainerRule9015
LayerRule9016
ScopeRule9017
StartingStyleRule9018
KeyframesRule9019
FontFaceRule9020
PageRule9021
PageMarginRule9022A margin rule of a @page rule, such as @top-left.
PropertyRule9023
CounterStyleRule9024
FontFeatureValuesRule9025
FontFeatureValueBlockRule9026A feature block of a @font-feature-values rule, such as @swash or @styleset.
FontPaletteValuesRule9027
PositionTryRule9028
ViewTransitionRule9029
CustomMediaRule9030
FunctionRule9031
UnknownAtRule9049An at-rule this parser does not know, or a known one where it does not belong.
Block9050The { ... } body of a rule.
Declaration9051
Important9052The !important at the end of a declaration.
BadDeclaration9053Text in a block that is neither a declaration nor a rule, which a browser drops.
IgnoredToken9054A token a style sheet or a block ignores, such as a stray ;.
SkippedText9055Text the parser could not use, such as a block nested beyond the depth limit.
TokenValue9100A component value that is a single token.
Function9101
ParenthesizedBlock9102A ( ... ) block.
BracketedBlock9103A [ ... ] block.
BracedBlock9104A { ... } block in a value.
SkippedValue9105Values nested beyond the depth limit.
GenericPrelude9106A prelude kept as component values, either because the rule has no grammar here or because it does not match it.
SelectorList9200
ComplexSelector9201
ComplexSelectorPart9202
ChildCombinator9203>
NextSiblingCombinator9204+
SubsequentSiblingCombinator9205~
ColumnCombinator9206||
CompoundSelector9207
InvalidSelector9208An item of a forgiving selector list, such as the argument of :is(), that does not parse and so matches nothing.
NamespacePrefix9209
TypeSelector9210
UniversalSelector9211
NestingSelector9212
IdSelector9213
ClassSelector9214
AttributeSelector9215
PseudoClassSelector9216
PseudoElementSelector9217
FunctionalPseudoClassSelector9218
FunctionalPseudoElementSelector9219
NthArgument9220
AnPlusB9221
NameList9222
ViewTransitionPartSelector9223
NamePrelude9300
ImportPrelude9301
ImportLayer9302
ImportSupports9303
NamespacePrelude9304
LayerName9305
LayerPrelude9306
ScopePrelude9307
ScopeBoundary9308
KeyframeSelectorList9309
KeyframeSelector9310
PageSelectorList9311
PageSelector9312
PseudoPage9313
CustomMediaPrelude9314
ContainerPrelude9315
ContainerCondition9316
ConditionPrelude9317
MediaQueryList9400
MediaTypeQuery9401
MediaConditionQuery9402
InvalidMediaQuery9403A media query that does not parse, which matches nothing without invalidating the rest of the list.
NotCondition9410
AndCondition9411
OrCondition9412
ParenthesizedCondition9413
GeneralEnclosed9414A parenthesized or functional condition this parser has no grammar for. It is valid and evaluates to false.
PlainFeature9415A feature with a value, such as (min-width: 600px).
BooleanFeature9416A feature without a value, such as (hover).
RangeFeature9417A feature compared to values, such as (400px <= width < 800px).
LessThanComparison9418
LessThanOrEqualComparison9419
GreaterThanComparison9420
GreaterThanOrEqualComparison9421
EqualComparison9422
FeatureValue9423
DeclarationCondition9424A declaration used as a condition, such as (display: grid) in @supports.
SelectorFunction9425selector() in @supports.
FontTechFunction9426font-tech() in @supports.
FontFormatFunction9427font-format() in @supports.
AtRuleFunction9428at-rule() in @supports.
StyleQuery9429style() in @container.
ScrollStateQuery9430scroll-state() in @container.