public static function SassColour::isa in Sassy 7
Same name and namespace in other branches
- 7.3 phpsass/script/literals/SassColour.php \SassColour::isa()
* Returns a value indicating if a token of this type can be matched at * the start of the subject string. *
Parameters
string the subject string: * @return mixed match at the start of the string or false if no match
Overrides SassLiteral::isa
1 call to SassColour::isa()
- SassScriptLexer::lex in phamlp/
sass/ script/ SassScriptLexer.php - * Lex an expression into SassScript tokens. *
File
- phamlp/
sass/ script/ literals/ SassColour.php, line 876
Class
- SassColour
- SassColour class. A SassScript object representing a CSS colour.
Code
public static function isa($subject) {
if (empty(self::$regex)) {
self::$regex = str_replace('{CSS_COLOURS}', join('|', array_reverse(array_keys(self::$svgColours))), self::MATCH);
}
return preg_match(self::$regex, strtolower($subject), $matches) ? $matches[0] : false;
}