From d49e44ddc1d691b11483395bb5b02a78c420356d Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 13 Aug 2017 13:32:24 +0300 Subject: [PATCH] csslint: CSS variables * kinda fixes #149 * primitive recognition only (it's not like we expect csslint to be smart anyway) --- vendor/csslint/csslint-worker.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vendor/csslint/csslint-worker.js b/vendor/csslint/csslint-worker.js index 46a72d4b..bc0139c3 100644 --- a/vendor/csslint/csslint-worker.js +++ b/vendor/csslint/csslint-worker.js @@ -4761,7 +4761,12 @@ TokenStream.prototype = mix(new TokenStreamBase(), { */ case "-": if (reader.peek() === "-") { //could be closing HTML-style comment - token = this.htmlCommentEndToken(c, startLine, startCol); + //or CSS variable + if (/\w/.test(reader.peek(2))) { + token = this.identOrFunctionToken(c, startLine, startCol); + } else { + token = this.htmlCommentEndToken(c, startLine, startCol); + } } else if (isNameStart(reader.peek())) { token = this.identOrFunctionToken(c, startLine, startCol); } else { @@ -5903,7 +5908,7 @@ var Validation = module.exports = { value = expression.value, part; - result = Matcher.parse(types).match(expression); + result = Matcher.parse(types + ' | ').match(expression); if (!result) { if (expression.hasNext() && !expression.isFirst()) { @@ -6270,6 +6275,8 @@ copy(ValidationTypes, { return part.type === "uri"; }, + "": "var()", + "": "" },