class CssSelectorConstraint
Checks if the string is a correct CSS selector.
Attributes
#[Constraint(id: 'CssSelector', label: new TranslatableMarkup('CSS selector', [], [
'context' => 'Validation',
]))]
Hierarchy
- class \Drupal\Core\Theme\Plugin\Validation\Constraint\CssSelectorConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of CssSelectorConstraint
1 file declares its use of CssSelectorConstraint
- CssSelectorConstraintValidatorTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Theme/ DesignToken/ CssSelectorConstraintValidatorTest.php
File
-
core/
lib/ Drupal/ Core/ Theme/ Plugin/ Validation/ Constraint/ CssSelectorConstraint.php, line 14
Namespace
Drupal\Core\Theme\Plugin\Validation\ConstraintView source
class CssSelectorConstraint extends SymfonyConstraint {
public function __construct(public string $message = 'The CSS selector @scope is invalid.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct(groups: $groups, payload: $payload);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.