diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 532124e89..139e954af 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -1598,7 +1598,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { // Custom property values get permissive parsing if (name[0].value && name[0].value.slice(0, 2) === '--') { - value = this.permissiveValue(/[;}]/); + if (parserInput.$char(';')) { + value = new Anonymous(''); + } else { + value = this.permissiveValue(/[;}]/); + } } // Try to store values as anonymous // If we need the value later we'll re-parse it in ruleset.parseValue diff --git a/packages/test-data/css/_main/variables.css b/packages/test-data/css/_main/variables.css index fa03b1eb7..ffa374106 100644 --- a/packages/test-data/css/_main/variables.css +++ b/packages/test-data/css/_main/variables.css @@ -69,3 +69,11 @@ mul-px-2: 140px; mul-px-3: 140px; } +*, +::before, +::after { + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; +} diff --git a/packages/test-data/less/_main/variables.less b/packages/test-data/less/_main/variables.less index ae8c9be45..4f3a7a324 100644 --- a/packages/test-data/less/_main/variables.less +++ b/packages/test-data/less/_main/variables.less @@ -125,3 +125,10 @@ mul-px-3: ((@px * 1) * @cm); } } + +*, ::before, ::after { + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; +}