summaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2012-09-11 16:27:05 +0300
committerMarc Englund <marc@vaadin.com>2012-09-11 16:27:28 +0300
commitc9e8218799152dd90bacb6c8b92b648a951aca24 (patch)
tree88838e0fdaf1257258d2e3d5eaffd7cb88819ab6 /theme-compiler/src/com/vaadin/sass/ScssStylesheet.java
parent6ccbb9e40ebb160d2bc1a57c5b5293c4f87d0b27 (diff)
downloadvaadin-framework-c9e8218799152dd90bacb6c8b92b648a951aca24.tar.gz
vaadin-framework-c9e8218799152dd90bacb6c8b92b648a951aca24.zip
Applying patch: remak of variable handling in sass (partial for e.g #9492 and others)
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/ScssStylesheet.java')
-rw-r--r--theme-compiler/src/com/vaadin/sass/ScssStylesheet.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java
index b38cab82a0..e2ffe060bc 100644
--- a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java
+++ b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java
@@ -31,9 +31,11 @@ import com.vaadin.sass.parser.Parser;
import com.vaadin.sass.resolver.ScssStylesheetResolver;
import com.vaadin.sass.resolver.VaadinResolver;
import com.vaadin.sass.tree.Node;
+import com.vaadin.sass.tree.VariableNode;
import com.vaadin.sass.visitor.BlockVisitor;
-import com.vaadin.sass.visitor.ControlVisitor;
+import com.vaadin.sass.visitor.EachVisitor;
import com.vaadin.sass.visitor.ExtendVisitor;
+import com.vaadin.sass.visitor.IfElseVisitor;
import com.vaadin.sass.visitor.ImportVisitor;
import com.vaadin.sass.visitor.MixinVisitor;
import com.vaadin.sass.visitor.NestPropertiesVisitor;
@@ -116,16 +118,17 @@ public class ScssStylesheet extends Node {
* @throws Exception
*/
public void compile() throws Exception {
+ ScssStylesheet scssStylesheet = this;
List<Visitor> visitors = new ArrayList<Visitor>();
visitors.add(new ImportVisitor());
- visitors.add(new MixinVisitor());
visitors.add(new VariableVisitor());
+ visitors.add(new MixinVisitor());
+ visitors.add(new IfElseVisitor());
visitors.add(new ParentSelectorVisitor());
visitors.add(new BlockVisitor());
visitors.add(new NestPropertiesVisitor());
visitors.add(new ExtendVisitor());
- visitors.add(new ControlVisitor());
- ArrayList<Node> children2 = children;
+ visitors.add(new EachVisitor());
for (Visitor visitor : visitors) {
visitor.traverse(this);
}
@@ -156,4 +159,11 @@ public class ScssStylesheet extends Node {
String output = string.toString();
return output;
}
+
+ public void addChild(int index, VariableNode node) {
+ if (node != null) {
+ children.add(index, node);
+ }
+ }
+
}