Skip to content

Commit 4c170da

Browse files
committed
special case of properties that starts with two minus letters. fix #56
1 parent e0efceb commit 4c170da

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/com/inet/lib/less/LessParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ private static boolean isIdentifier( StringBuilder builder ) {
13341334
ch = builder.charAt( i++ );
13351335
continue FIRST;
13361336
}
1337-
return false;
1337+
return true; // special case of properties that starts with two minus letters. see https://developer.mozilla.org/de/docs/Web/CSS/var
13381338
case 'U':
13391339
if( builder.length() > 1 && builder.charAt( 1 ) == '+' ) {
13401340
//unicode-range

test/com/inet/lib/less/samples/general/minus.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@
2626
calcCompact: calc(100%-98px);
2727
calcVariable: calc(90% -10px);
2828
}
29+
:root {
30+
--main-bg-color: pink;
31+
}
32+
body {
33+
background-color: var(--main-bg-color);
34+
}

test/com/inet/lib/less/samples/general/minus.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@
2929
@a : 90%;
3030
@b : 10px;
3131
calcVariable: calc(@a -@b);
32+
}
33+
:root {
34+
--main-bg-color: pink;
35+
}
36+
body {
37+
background-color: var(--main-bg-color);
3238
}

0 commit comments

Comments
 (0)