PHP Class SassRuleNode

Represents a CSS rule.
Inheritance: extends SassNode
Afficher le fichier Open project: richthegeek/phpsass Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( object $token ) : SassRuleNode SassRuleNode constructor.
addSelectors ( string $selectors, boolean $explode = true ) Adds selector(s) to the rule.
extend ( ) Extend this nodes selectors $extendee is the subject of the @extend directive $extender is the selector that contains the @extend directive $selector a selector or selector sequence that is to be extended
getIsContinued ( ) : boolean Returns a value indicating if the selectors for this rule are to be continued.
getSelectors ( ) : array Returns the selectors
isPlaceholder ( $selector )
parse ( SassContext $context ) : array Parse this node and its children into static nodes.
render ( ) : string Render this node and its children to CSS.
resolveSelectors ( SassContext $context ) : array Resolves selectors.

Méthodes protégées

Méthode Description
getParentSelectors ( mixed $context ) : array Returns the parent selector(s) for this node.

Private Methods

Méthode Description
explode ( string $string ) : array Explodes a string of selectors into an array.
hasParentReference ( string $selector ) : boolean Determines if there is a parent reference in the selector
isPsuedo ( string $selector ) : boolean Tests whether the selector is a psuedo selector
isSequence ( string $selector ) : boolean Tests whether the selector is a sequence selector
mergeSequence ( string $extender, string $extendee, string $selector ) : array Merges selector sequences
parentReferencePos ( string $selector ) : mixed Returns the position of the first parent reference in the selector.
resolveParentReferences ( string $selector, mixed $context ) : string Resolves parent references in the selector

Method Details

__construct() public méthode

SassRuleNode constructor.
public __construct ( object $token ) : SassRuleNode
$token object source token
Résultat SassRuleNode

addSelectors() public méthode

If the selectors are to continue for the rule the selector must end in a comma
public addSelectors ( string $selectors, boolean $explode = true )
$selectors string selector
$explode boolean

extend() public méthode

Extend this nodes selectors $extendee is the subject of the @extend directive $extender is the selector that contains the @extend directive $selector a selector or selector sequence that is to be extended
public extend ( )

getIsContinued() public méthode

Returns a value indicating if the selectors for this rule are to be continued.
public getIsContinued ( ) : boolean
Résultat boolean rue if the selectors for this rule are to be continued false if not

getParentSelectors() protected méthode

This in an empty array if there is no parent selector.
protected getParentSelectors ( mixed $context ) : array
$context mixed
Résultat array the parent selector for this node

getSelectors() public méthode

Returns the selectors
public getSelectors ( ) : array
Résultat array selectors

isPlaceholder() public méthode

public isPlaceholder ( $selector )

parse() public méthode

Parse this node and its children into static nodes.
public parse ( SassContext $context ) : array
$context SassContext the context in which this node is parsed
Résultat array the parsed node and its children

render() public méthode

Render this node and its children to CSS.
public render ( ) : string
Résultat string the rendered node

resolveSelectors() public méthode

Interpolates SassScript in selectors and resolves any parent references or appends the parent selectors.
public resolveSelectors ( SassContext $context ) : array
$context SassContext the context in which this node is parsed Change: 7/Dec/11 - change to make selector ordering conform to Ruby compiler.
Résultat array