code: function clean(root, preserve) {
    root.walkAtRules('critical', function (atRule) {
      if (preserve === false) {
        if (atRule.nodes && atRule.nodes.length) {
          atRule.remove();
        } else {
          root.removeAll();
        }
      } else {
        if (atRule.nodes && atRule.nodes.length) {
          atRule.replaceWith(atRule.nodes);
        } else {
          atRule.remove();
        }
      }
    });
    // @TODO `scope` Makes this kind of gnarly. This could be cleaned up a bit.
    root.walkDecls(/critical-(selector|filename)/, function (decl) {
      if (preserve === false) {
        if (decl.value === 'scope') {
          root.walk(function (node) {
            if (node.selector && node.selector.indexOf(decl.parent.selector) === 0) {
              if (node.parent && hasNoOtherChildNodes(node.parent.nodes, node)) {
                node.parent.remove();
              } else {
                node.remove();
              }
            }
          });
        }
        var wrapper = {};
        if (decl && decl.parent) {
          wrapper = decl.parent.parent;
          decl.parent.remove();
        }
        // If the wrapper has no valid child nodes, remove it entirely.
        if (wrapper && hasNoOtherChildNodes(wrapper.nodes, decl)) {
          wrapper.remove();
        }
      } else {
        decl.remove();
      }
    });
  }
docs: Clean the original root node passed to the plugin, removing custom atrules,
  properties. Will additionally delete nodes as appropriate if
  `preserve === false`.
  
  @param {Object} root The root PostCSS object.
  @param {boolean} preserve Preserve identified critical CSS in the root?