From 498328a3d7c71517bc914b7cc6af8a1c94a8a742 Mon Sep 17 00:00:00 2001 From: Toni Ruottu Date: Fri, 20 Mar 2015 13:50:00 +0200 Subject: [PATCH] Fix basic plain CSS support, fixes #507 --- lib/modules/variable-parser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/variable-parser.js b/lib/modules/variable-parser.js index 4375ce1b..d5fade3e 100644 --- a/lib/modules/variable-parser.js +++ b/lib/modules/variable-parser.js @@ -24,7 +24,7 @@ function parseVariableDeclarations(string, syntax) { }), visitors = { sass: { - // Visitor for SASS and SCSS syntaxes + // Visitor for SASS, SCSS and plain CSS syntaxes test: function(name, nodes) { return name === 'declaration' && nodes[1][0] === 'variable'; }, @@ -67,6 +67,7 @@ function parseVariableDeclarations(string, syntax) { }, visitor; + visitors.css = visitors.sass; visitors.scss = visitors.sass; visitor = visitors[syntax]; @@ -86,7 +87,7 @@ function findVariables(string, syntax) { }), visitors = { sass: { - // Visitor for SASS and SCSS syntaxes + // Visitor for SASS, SCSS and plain CSS syntaxes test: function(name, nodes) { return (name === 'declaration' && nodes[1][0] === 'variable') || (name === 'variable' && nodes[0] === 'ident'); }, @@ -101,6 +102,7 @@ function findVariables(string, syntax) { // For this task LESS visitor is identical to SASS visitors.less = visitors.sass; + visitors.css = visitors.sass; visitors.scss = visitors.sass; visitor = visitors[syntax];