# File lib/sass/tree/visitors/cssize.rb, line 223
  def visit_directive(node)
    return node unless node.has_children
    if parent.is_a?(Sass::Tree::RuleNode)
      # @keyframes shouldn't include the rule nodes, so we manually create a
      # bubble that doesn't have the parent's contents for them.
      return node.normalized_name == '@keyframes' ? Bubble.new(node) : bubble(node)
    end

    yield

    # Since we don't know if the mere presence of an unknown directive may be
    # important, we should keep an empty version around even if all the contents
    # are removed via @at-root. However, if the contents are just bubbled out,
    # we don't need to do so.
    directive_exists = node.children.any? do |child|
      next true unless child.is_a?(Bubble)
      next false unless child.node.is_a?(Sass::Tree::DirectiveNode)
      child.node.resolved_value == node.resolved_value
    end

    # We know empty @keyframes directives do nothing.
    if directive_exists || node.name == '@keyframes'
      []
    else
      empty_node = node.dup
      empty_node.children = []
      [empty_node]
    end + debubble(node.children, node)
  end