&& expr.getParameters().toString()
.contains("$" + node.getName())) {
replaceValues(expr.getParameters(), node);
+ } else if (expr.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE) {
+ replaceValues(expr, node);
}
}
}
$blue: #3bbfce;
$margin: 8px;
$chameleon-font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+$font: 12px;
.content-navigation {
border-color: $blue;
color: $blue;
color1: darken($blue, 9%);
font-family: $chameleon-font-family;
+ $font-size: $font;
+ font-size: $font-size;
}
.border {
parser.setDocumentHandler(handler);
parser.parseStyleSheet(getClass().getResource(scss).getPath());
ScssStylesheet root = handler.getStyleSheet();
- Assert.assertEquals(5, root.getChildren().size());
+ Assert.assertEquals(6, root.getChildren().size());
VariableNode varNode1 = (VariableNode) root.getChildren().get(0);
Assert.assertEquals("blue", varNode1.getName());
Assert.assertEquals(8f, varNode2.getExpr().getFloatValue());
Assert.assertEquals("px", varNode2.getExpr().getDimensionUnitText());
- BlockNode blockNode1 = (BlockNode) root.getChildren().get(4);
+ BlockNode blockNode1 = (BlockNode) root.getChildren().get(5);
Assert.assertEquals(3, blockNode1.getChildren().size());
RuleNode ruleNode1Block1 = (RuleNode) blockNode1.getChildren().get(2);
Assert.assertEquals("border-color", ruleNode1Block1.getVariable());
.getValue().getLexicalUnitType());
Assert.assertEquals("blue", ruleNode2Block1.getValue().getStringValue());
- BlockNode blockNode2 = (BlockNode) root.getChildren().get(4);
+ BlockNode blockNode2 = (BlockNode) root.getChildren().get(5);
RuleNode ruleNode1Block2 = (RuleNode) blockNode2.getChildren().get(0);
Assert.assertEquals("padding", ruleNode1Block2.getVariable());
Assert.assertEquals(SCSSLexicalUnit.SCSS_VARIABLE, ruleNode1Block2