Skip to content

Commit

Permalink
Merge pull request #2506 from F4-Group/2485-fix-property-lookup-negation
Browse files Browse the repository at this point in the history
Fix property lookup negation
  • Loading branch information
xdan committed Jul 16, 2020
2 parents 4387374 + 1ea700b commit 1406479
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Lexer.prototype = {

ident: function() {
var captures;
if (captures = /^-*[@_a-zA-Z$][-\w\d$]*/.exec(this.str)) {
if (captures = /^-*([_a-zA-Z$]|@apply)[-\w\d$]*/.exec(this.str)) {
this.skip(captures);
return new Token('ident', new nodes.Ident(captures[0]));
}
Expand Down
10 changes: 10 additions & 0 deletions test/cases/negative-property-lookup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.negative-property-lookup {
margin-top: 20px;
bottom: -20px;
top: -10px;
}
.another-example {
margin-top: 20px;
bottom: -20px;
top: -10px;
}
9 changes: 9 additions & 0 deletions test/cases/negative-property-lookup.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.negative-property-lookup
margin-top: 20px;
bottom: -@margin-top;
top: -@margin-top + 10px;

.another-example
margin-top: 20px;
bottom: - @margin-top;
top: -(@margin-top) + 10px;

0 comments on commit 1406479

Please sign in to comment.