Class: Sass::Tree::MediaNode

Inherits:
DirectiveNode show all
Defined in:
lib/sass/tree/media_node.rb

Overview

A static node representing a @media rule. @media rules behave differently from other directives in that when they're nested within rules, they bubble up to top-level.

See Also:

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #filename, #has_children, #line, #options

Instance Method Summary collapse

Methods inherited from Node

#<<, #==, #balance, #deep_copy, #do_extend, #each, #invisible?, #style, #to_s, #to_sass, #to_scss

Constructor Details

#initialize(query) ⇒ MediaNode

Returns a new instance of MediaNode.

Parameters:

  • query (Array<String>)

    See #query



21
22
23
24
25
# File 'lib/sass/tree/media_node.rb', line 21

def initialize(query)
  @query = query
  @tabs = 0
  super('')
end

Instance Attribute Details

#group_end

See Also:



18
19
20
# File 'lib/sass/tree/media_node.rb', line 18

def group_end
  @group_end
end

#queryArray<String>

The media query. A list of comma-separated queries (e.g. print or screen).

Returns:

  • (Array<String>)


12
13
14
# File 'lib/sass/tree/media_node.rb', line 12

def query
  @query
end

#tabs

See Also:



15
16
17
# File 'lib/sass/tree/media_node.rb', line 15

def tabs
  @tabs
end

Instance Method Details

#value



28
29
30
# File 'lib/sass/tree/media_node.rb', line 28

def value
  "@media #{query.join(', ')}"
end