diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index b87b4d762..1fa571568 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -1604,6 +1604,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { value = this.permissiveValue(/[;}]/); } } + else if (isVariable) { + value = this.variableValue(); + } // Try to store values as anonymous // If we need the value later we'll re-parse it in ruleset.parseValue else { @@ -1638,6 +1641,18 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.restore(); } }, + variableValue: function () { + let match = this.anonymousValue(); + if (match) { + return match; + } else { + const index = parserInput.i; + match = parserInput.$re(/^([^#@$+/'"*`(;{}-]*);|(^[(?!.*\n)^.#@$+/'"*`(;{}-]*)(["'])((?!.*@.*)(?