Class: Sass::Tree::MediaNode
- Inherits:
-
DirectiveNode
- Object
- Node
- DirectiveNode
- Sass::Tree::MediaNode
- 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.
Instance Attribute Summary collapse
- #group_end
-
#query ⇒ Array<String>
The media query.
- #tabs
Attributes inherited from Node
#children, #filename, #has_children, #line, #options
Instance Method Summary collapse
-
#initialize(query) ⇒ MediaNode
constructor
A new instance of MediaNode.
- #value
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.
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
18 19 20 |
# File 'lib/sass/tree/media_node.rb', line 18
def group_end
@group_end
end
|
#query ⇒ Array<String>
The media query. A list of comma-separated queries (e.g. print
or screen
).
12 13 14 |
# File 'lib/sass/tree/media_node.rb', line 12
def query
@query
end
|
#tabs
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
|