PHP Class SassPropertyNode

Represents a CSS property.
Inheritance: extends SassNode
Datei anzeigen Open project: richthegeek/phpsass Class Usage Examples

Public Properties

Property Type Description
$important
$name property name
$psuedoSelectors
$value property value or expression to evaluate

Public Methods

Method Description
__construct ( object $token, string $syntax = 'new' ) : SassPropertyNode SassPropertyNode constructor.
getName ( ) : string Returns the name of this property.
getNamespace ( ) : string Returns the namespace for this node
getValue ( ) : string Returns the parsed value of this property.
inNamespace ( ) : boolean Returns a value indicating if this node is in a namespace
isPseudoSelector ( string $string ) : boolean Returns a value indicating if the string starts with a pseudo selector.
isa ( object $token ) : boolean Returns a value indicating if the token represents this type of node.
match ( object $token, string $syntax ) : array Returns the matches for this type of node.
parse ( SassContext $context ) : array Parse this node.
render ( ) : string Render this node.

Method Details

__construct() public method

SassPropertyNode constructor.
public __construct ( object $token, string $syntax = 'new' ) : SassPropertyNode
$token object source token
$syntax string property syntax
return SassPropertyNode

getName() public method

If the property is in a namespace the namespace is prepended
public getName ( ) : string
return string the name of this property

getNamespace() public method

Returns the namespace for this node
public getNamespace ( ) : string
return string the namespace for this node

getValue() public method

Returns the parsed value of this property.
public getValue ( ) : string
return string the parsed value of this property

inNamespace() public method

Returns a value indicating if this node is in a namespace
public inNamespace ( ) : boolean
return boolean true if this node is in a property namespace, false if not

isPseudoSelector() public static method

This is used to reject pseudo selectors as property values as, for example, "a:hover" and "text-decoration:underline" look the same to the property match regex. It will also match interpolation to allow for constructs such as content:#{$pos}
See also: isa()
public static isPseudoSelector ( string $string ) : boolean
$string string the string to test
return boolean true if the string starts with a pseudo selector, false if not

isa() public static method

Returns a value indicating if the token represents this type of node.
public static isa ( object $token ) : boolean
$token object token
return boolean true if the token represents this type of node, false if not

match() public static method

Returns the matches for this type of node.
public static match ( object $token, string $syntax ) : array
$token object
$syntax string the property syntax being used
return array matches

parse() public method

If the node is a property namespace return all parsed child nodes. If not return the parsed version of this node.
public parse ( SassContext $context ) : array
$context SassContext the context in which this node is parsed
return array the parsed node

render() public method

Render this node.
public render ( ) : string
return string the rendered node

Property Details

$important public_oe property

public $important

$name public_oe property

property name
public $name

$psuedoSelectors public_oe static_oe property

public static $psuedoSelectors

$value public_oe property

property value or expression to evaluate
public $value