code: function findVariables(string) {
    // Do not parse empty files. Otherwise gonzales.parse will fail
    if (!string) {
      return [];
    }
  
    var out = [],
        ast = gonzales.parse(string, {
          syntax: syntax
        }),
        visitor = {
          // Visitor for SASS, SCSS and plain CSS syntaxes
          test: function(name, nodes) {
            return (name === 'declaration' && nodes.content[0].content[0].type === 'variable') || (name === 'variable' && nodes.content[0].type === 'ident');
          },
          process: function(nodes) {
            if (nodes.type !== 'declaration') {
              out.push(nodes.content[0].content);
            }
          }
        };
  
    traverser.traverse(ast, visitor);
    return out;
  }
docs: Parse Style variables to object