css-selector-parser / Exports / SyntaxDefinition
CSS Selector Syntax Definition can be used to define custom CSS selector parsing rules.
• Optional
attributes: false
| { caseSensitivityModifiers?
: string
[] ; operators?
: string
[] ; unknownCaseSensitivityModifiers?
: "accept"
| "reject"
}
CSS Attribute Selector.
Example
[href="#"]
See
https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Attribute_selectors
• Optional
baseSyntax: CssLevel
When specified, syntax will be based on the specified predefined CSS standard. If not specified, syntax will be defined from scratch.
• Optional
classNames: boolean
CSS Class Names
Example
.element.highlighted
See
• Optional
combinators: string
[]
CSS selector rule nesting combinators.
Example
div.class > span
See
https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Combinators
• Optional
ids: boolean
CSS IDs (yes, there can be multiple).
Example
#root#root
See
• Optional
namespace: boolean
| { wildcard?
: boolean
}
CSS3 Namespaces.
Example
ns|div
See
https://www.w3.org/TR/css3-namespace/
• Optional
pseudoClasses: false
| { definitions?
: { Formula
: undefined
| string
[] ; FormulaOfSelector
: undefined
| string
[] ; NoArgument
: undefined
| string
[] ; Selector
: undefined
| string
[] ; String
: undefined
| string
[] } ; unknown?
: "accept"
| "reject"
}
CSS Pseudo-classes.
Example
:nth-child(2n+1)
See
• Optional
pseudoElements: false
| { definitions?
: string
[] | { NoArgument
: undefined
| string
[] ; Selector
: undefined
| string
[] ; String
: undefined
| string
[] } ; notation?
: "both"
| "singleColon"
| "doubleColon"
; unknown?
: "accept"
| "reject"
}
CSS Pseudo-elements.
Example
::before
See
• Optional
tag: boolean
| { wildcard?
: boolean
}
CSS Tag (type).
Example
div
See