getPreviousNode = function (node) {
  // Rulesets
  if (node.is('ruleset')) {
    return node.contains('selector') ? node.last('selector') : false;
  }

  // Conditonal statements
  if (node.is('conditionalStatement')) {
    var previousParent = node.contains('condition') ? node.last('condition') : false;
    return previousParent && previousParent.contains('atkeyword') ? previousParent.last('atkeyword') : false;
  }

  // Loops
  if (node.is('loop')) {
    return node.contains('atkeyword') ? node.last('atkeyword') : false;
  }

  // Mixins and atrules (functions etc)
  if (node.is('mixin') || node.is('atrule')) {
    if (node.contains('function')) {
      return node.last('function');
    }

    if (node.contains('arguments')) {
      return node.last('arguments');
    }
    return node.contains('atkeyword') ? node.last('atkeyword') : false;
  }

  return false;
}
Get the previous node

@param {Object} node - Our current node
@returns {Object|bool} The previous node or false if not found