Skip to content

Commit b6656b0

Browse files
committed
fix(issue:3737) allow blank variable declarations
* Fixes issue with blank CSS variable declarations.
1 parent e4fdbe3 commit b6656b0

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

packages/less/src/less/parser/parser.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) {
15981598

15991599
// Custom property values get permissive parsing
16001600
if (name[0].value && name[0].value.slice(0, 2) === '--') {
1601-
value = this.permissiveValue(/[;}]/);
1601+
if (parserInput.$char(';')) {
1602+
value = new Anonymous('');
1603+
} else {
1604+
value = this.permissiveValue(/[;}]/);
1605+
}
16021606
}
16031607
// Try to store values as anonymous
16041608
// If we need the value later we'll re-parse it in ruleset.parseValue

packages/test-data/css/_main/variables.css

+8
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,11 @@
6969
mul-px-2: 140px;
7070
mul-px-3: 140px;
7171
}
72+
*,
73+
::before,
74+
::after {
75+
--tw-pan-x: ;
76+
--tw-pan-y: ;
77+
--tw-pinch-zoom: ;
78+
--tw-scroll-snap-strictness: proximity;
79+
}

packages/test-data/less/_main/variables.less

+7
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,10 @@
125125
mul-px-3: ((@px * 1) * @cm);
126126
}
127127
}
128+
129+
*, ::before, ::after {
130+
--tw-pan-x: ;
131+
--tw-pan-y: ;
132+
--tw-pinch-zoom: ;
133+
--tw-scroll-snap-strictness: proximity;
134+
}

0 commit comments

Comments
 (0)