Skip to content

Commit

Permalink
Fix basic plain CSS support, fixes #507
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberixae committed Mar 20, 2015
1 parent 962495c commit 498328a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/modules/variable-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
},
Expand Down Expand Up @@ -67,6 +67,7 @@ function parseVariableDeclarations(string, syntax) {
},
visitor;

visitors.css = visitors.sass;
visitors.scss = visitors.sass;
visitor = visitors[syntax];

Expand All @@ -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');
},
Expand All @@ -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];

Expand Down

0 comments on commit 498328a

Please sign in to comment.