# class Sass::Tree::AtRootNode

A dynamic node representing an `@at-root` directive.

An `@at-root` directive with a selector is converted to an {AtRootNode} containing a {RuleNode} at parse time.

@see Sass::Tree

### Attributes

group_end[RW]

Whether the last child of this node should be considered the end of a group.

@return [Boolean]

query[RW]

The query for this node (e.g. `(without: media)`), interspersed with {Sass::Script::Tree::Node}s representing `#{}`-interpolation. Any adjacent strings will be merged together.

This will be nil if the directive didn't have a query. In this case, {#resolved_type} will automatically be set to `:without` and {#resolved_rule} will automatically be set to `[“rule”]`.

@return [Array<String, Sass::Script::Tree::Node>]

resolved_type[RW]

The resolved type of this directive. `:with` or `:without`.

@return [Symbol]

resolved_value[RW]

The resolved value of this directive – a list of directives to either include or exclude.

@return [Array<String>]

tabs[RW]

The number of additional tabs that the contents of this node should be indented.

@return [Number]

### Public Class Methods

new(query = nil) click to toggle source
Calls superclass method

    # File lib/sass/tree/at_root_node.rb, line 45
    def initialize(query = nil)
      super()
      @query = Sass::Util.strip_string_array(Sass::Util.merge_adjacent_strings(query)) if query
      @tabs = 0
    end

### Public Instance Methods

bubbles?() click to toggle source

@see Sass::Tree::Node#bubbles?

    # File lib/sass/tree/at_root_node.rb, line 78
    def bubbles?
      true
    end

exclude?(directive) click to toggle source

Returns whether or not the given directive is excluded by this node. `directive` may be “rule”, which indicates whether normal CSS rules should be excluded.

@param directive [String] @return [Boolean]

    # File lib/sass/tree/at_root_node.rb, line 57
    def exclude?(directive)
      if resolved_type == :with
        return false if resolved_value.include?('all')
        !resolved_value.include?(directive)
      else # resolved_type == :without
        return true if resolved_value.include?('all')
        resolved_value.include?(directive)
      end
    end

exclude_node?(node) click to toggle source

Returns whether the given node is excluded by this node.

@param node [Sass::Tree::Node] @return [Boolean]

    # File lib/sass/tree/at_root_node.rb, line 71
    def exclude_node?(node)
      return exclude?(node.name.gsub(/^@/, '')) if node.is_a?(Sass::Tree::DirectiveNode)
      return exclude?('keyframes') if node.is_a?(Sass::Tree::KeyframeRuleNode)
      exclude?('rule') && node.is_a?(Sass::Tree::RuleNode)
    end