inc/sass-get-var.js
function gather (variable, node) {
  if (node.parent) {
    let values = []
    for (let n of Object.values(node.parent.nodes)) {
      if (n.type === 'decl' && n.prop === `$${variable}`) {
        values.push(n.value)
      }
    }
    values.reverse()
    let parentValues = node.parent.parent ? gather(variable, node.parent) : null
    if (parentValues) {
      values = values.concat(parentValues)
    }
    return values
  }
  return null
}
function gather (variable, node) {
  if (node.parent) {
    let values = []
    for (let n of Object.values(node.parent.nodes)) {
      if (n.type === 'decl' && n.prop === `$${variable}`) {
        values.push(n.value)
      }
    }
    values.reverse()
    let parentValues = node.parent.parent ? gather(variable, node.parent) : null
    if (parentValues) {
      values = values.concat(parentValues)
    }
    return values
  }
  return null
}
function gather ( variable , node ) { if ( node . parent ) { let values = [ ] for ( let n of Object . values ( node . parent . nodes ) ) { if ( n . type === 'decl' && n . prop === ` ${ variable } ` ) { values . push ( n . value ) } } values . reverse ( ) let parentValues = node . parent . parent ? gather ( variable , node . parent ) : null if ( parentValues ) { values = values . concat ( parentValues ) } return values } return null }
get the value of a sass variable
@param {string} variable
@param {object} node
get the value of a sass variable