aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/tree/MixinNode.java')
-rw-r--r--theme-compiler/src/com/vaadin/sass/tree/MixinNode.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java b/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java
index 0267b88e2d..2b9299bbd1 100644
--- a/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java
+++ b/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java
@@ -21,7 +21,9 @@ import java.util.Collection;
import org.w3c.css.sac.LexicalUnit;
-public class MixinNode extends Node {
+import com.vaadin.sass.parser.LexicalUnitImpl;
+
+public class MixinNode extends Node implements IVariableNode {
private static final long serialVersionUID = 4725008226813110658L;
private String name;
@@ -56,4 +58,17 @@ public class MixinNode extends Node {
public void setArglist(ArrayList<LexicalUnit> arglist) {
this.arglist = arglist;
}
+
+ @Override
+ public void replaceVariables(ArrayList<VariableNode> variables) {
+ for (final VariableNode var : variables) {
+ for (final LexicalUnit arg : new ArrayList<LexicalUnit>(arglist)) {
+ if (arg.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE
+ && arg.getStringValue().equals(var.getName())) {
+ ((LexicalUnitImpl) arg).replaceValue(var.getExpr());
+ }
+ }
+ }
+ }
+
}