9 public function validate($string, $config, $context) {
11 $string = trim($string);
14 if (!$string)
return false;
16 $pattern =
'/^(-?[A-Za-z_][A-Za-z_\-0-9]*)$/';
17 if (!preg_match($pattern, $string))
return false;
Base class for all validating attribute definitions.
Validates based on {ident} CSS grammar production.
validate($string, $config, $context)