aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java b/theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java
index 5aa90151b9..0469333965 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java
@@ -45,19 +45,19 @@ public class MixinNodeHandler {
private static void replaceMixinNode(MixinNode mixinNode,
MixinDefNode mixinDef) {
- Node pre = mixinNode;
-
MixinDefNode defClone = (MixinDefNode) DeepCopy.copy(mixinDef);
defClone.traverse();
+ defClone.replaceContentDirective(mixinNode);
+
if (mixinDef.getArglist().isEmpty()) {
- for (Node child : new ArrayList<Node>(defClone.getChildren())) {
- mixinNode.getParentNode().appendChild(child, pre);
- pre = child;
- }
+ mixinNode.getParentNode().appendChildrenAfter(
+ new ArrayList<Node>(defClone.getChildren()), mixinNode);
} else {
-
- replacePossibleArguments(mixinNode, defClone);
+ if (mixinNode.getArglist() != null
+ && !mixinNode.getArglist().isEmpty()) {
+ replacePossibleArguments(mixinNode, defClone);
+ }
Node previous = mixinNode;
for (final Node child : defClone.getChildren()) {
@@ -87,7 +87,6 @@ public class MixinNodeHandler {
*/
private static void replacePossibleArguments(MixinNode mixinNode,
MixinDefNode def) {
-
if (mixinNode.getArglist().size() > 0) {
ArrayList<VariableNode> remainingNodes = new ArrayList<VariableNode>(
def.getArglist());