com.vaadin.sass.internal.visitor
Class ExtendNodeHandler

java.lang.Object
  extended by com.vaadin.sass.internal.visitor.ExtendNodeHandler

public class ExtendNodeHandler
extends Object


Constructor Summary
ExtendNodeHandler()
           
 
Method Summary
static SelectorSet createSelectorsForExtensions(Selector target, Iterable<Extension> extendsMap)
          Try to unify argument selector with each selector specified in an extend-clause.
static void modifyTree(ScssContext context, Node node)
           
static Collection<Node> traverse(ScssContext context, ExtendNode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendNodeHandler

public ExtendNodeHandler()
Method Detail

traverse

public static Collection<Node> traverse(ScssContext context,
                                        ExtendNode node)
                                 throws Exception
Throws:
Exception

modifyTree

public static void modifyTree(ScssContext context,
                              Node node)
                       throws Exception
Throws:
Exception

createSelectorsForExtensions

public static SelectorSet createSelectorsForExtensions(Selector target,
                                                       Iterable<Extension> extendsMap)
Try to unify argument selector with each selector specified in an extend-clause. For each match found, add the enclosing block's selectors with substitutions (see examples below). Finally eliminates redundant selectors (a selector is redundant in a set if subsumed by another selector in the set). .a {...}; .b { @extend .a } ---> .b .a.b {...}; .c { @extend .a } ---> .b.c .a.b {...}; .c .c { @extend .a } ---> .c .b.c

Parameters:
target - the selector to match
extendsMap - mapping from the simple selector sequence of the extend-selector to an extending selector
Returns:
the generated selectors (may contain duplicates)


Copyright © 2013–2015 Vaadin. All rights reserved.