css-sanitizer
Classes to parse and sanitize CSS
Loading...
Searching...
No Matches
Wikimedia\CSS\Grammar\CustomPropertyMatcher Class Reference

Matcher that matches a custom property (a CSS variable) example –name-of-variable. More...

+ Inheritance diagram for Wikimedia\CSS\Grammar\CustomPropertyMatcher:
+ Collaboration diagram for Wikimedia\CSS\Grammar\CustomPropertyMatcher:

Protected Member Functions

 generateMatches (ComponentValueList $values, $start, array $options)
 @inheritDoc
 
- Protected Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
 next (ComponentValueList $values, $start, array $options)
 Find the next ComponentValue in the input, possibly skipping whitespace.
 
 makeMatch (ComponentValueList $list, $start, $end, GrammarMatch $submatch=null, array $stack=[])
 Create a GrammarMatch.
 

Additional Inherited Members

- Public Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
 capture ( $captureName)
 Return a copy of this matcher that will capture its matches.
 
 matchAgainst (ComponentValueList $values, array $options=[])
 Match against a list of ComponentValues.
 
 getDefaultOptions ()
 Fetch the default options for this Matcher.
 
 setDefaultOptions (array $options)
 Set the default options for this Matcher.
 
- Static Public Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
static create (... $args)
 Create an instance.
 
- Protected Attributes inherited from Wikimedia\CSS\Grammar\Matcher
 $captureName = null
 
 $defaultOptions
 

Detailed Description

Matcher that matches a custom property (a CSS variable) example –name-of-variable.

This utilises regex to match the custom property –[a-zA-Z][a-zA-Z0-9-] without any input validation.

See also
https://www.w3.org/TR/2022/CR-css-variables-1-20220616/#custom-property

Member Function Documentation

◆ generateMatches()

Wikimedia\CSS\Grammar\CustomPropertyMatcher::generateMatches ( ComponentValueList $values,
$start,
array $options )
protected

@inheritDoc

Reimplemented from Wikimedia\CSS\Grammar\Matcher.


The documentation for this class was generated from the following file: