Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/less/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contexts.Eval = class {

exitCalc() {
this.calcStack.pop();
if (!this.calcStack) {
if (!this.calcStack.length) {
this.inCalc = false;
}
}
Expand Down
9 changes: 9 additions & 0 deletions test/css/calc.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@
.c {
height: calc(100% - ((10px * 3) + (10px * 2)));
}
.correctly-exit-calc-mode h2 {
width: 10px;
}
.correctly-exit-calc-mode div {
width: calc(100px * 2);
}
.correctly-exit-calc-mode h1 {
color: white;
}
18 changes: 17 additions & 1 deletion test/less/calc.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,20 @@
.c {
@v: 10px;
height: calc(100% - ((@v * 3) + (@v * 2)));
}
}

.correctly-exit-calc-mode {
@a: 10;
h2 { width: unit(@a, px); }

div { width: calc(100px * 2); }

.mk-map() {
text: white;
background: black;
}

@p: .mk-map();

h1 { color: @p[text]; }
}
2 changes: 1 addition & 1 deletion test/sourcemaps/custom-props.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":3,"sources":["testweb/sourcemaps/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,gCAAA","file":"sourcemaps/custom-props.css"}
{"version":3,"sources":["testweb/sourcemaps/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"sourcemaps/custom-props.css"}