Class: Sass::Tree::CssImportNode
- Inherits:
-
DirectiveNode
- Object
- Node
- DirectiveNode
- Sass::Tree::CssImportNode
- Defined in:
- lib/sass/tree/css_import_node.rb
Overview
A node representing an @import
rule that's importing plain CSS.
Instance Attribute Summary collapse
-
#query ⇒ Array<String, Sass::Script::Node>
The media query for this rule, interspersed with Script::Nodes representing
#{}
-interpolation. -
#resolved_query ⇒ Sass::Media::QueryList
The media query for this rule, without any unresolved interpolation.
-
#resolved_uri ⇒ String
The text of the URI being imported after any interpolated SassScript has been resolved.
-
#uri ⇒ String, Sass::Script::Node
The URI being imported, either as a plain string or an interpolated script string.
Attributes inherited from Node
#children, #filename, #has_children, #line, #options
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uri, query = nil) ⇒ CssImportNode
constructor
A new instance of CssImportNode.
- #resolved_value
- #value
Methods inherited from DirectiveNode
Methods inherited from Node
#<<, #==, #balance, #bubbles?, #deep_copy, #each, #inspect, #invisible?, #style, #to_s, #to_sass, #to_scss
Constructor Details
#initialize(uri, query = nil) ⇒ CssImportNode
Returns a new instance of CssImportNode.
33 34 35 36 37 |
# File 'lib/sass/tree/css_import_node.rb', line 33
def initialize(uri, query = nil)
@uri = uri
@query = query
super('')
end
|
Instance Attribute Details
#query ⇒ Array<String, Sass::Script::Node>
The media query for this rule, interspersed with Script::Nodes
representing #{}
-interpolation. Any adjacent strings will be merged
together.
23 24 25 |
# File 'lib/sass/tree/css_import_node.rb', line 23
def query
@query
end
|
#resolved_query ⇒ Sass::Media::QueryList
The media query for this rule, without any unresolved interpolation. It's only set once Tree::Node#perform has been called.
29 30 31 |
# File 'lib/sass/tree/css_import_node.rb', line 29
def resolved_query
@resolved_query
end
|
#resolved_uri ⇒ String
The text of the URI being imported after any interpolated SassScript has been resolved. Only set once Visitors::Perform has been run.
16 17 18 |
# File 'lib/sass/tree/css_import_node.rb', line 16
def resolved_uri
@resolved_uri
end
|
#uri ⇒ String, Sass::Script::Node
The URI being imported, either as a plain string or an interpolated script string.
10 11 12 |
# File 'lib/sass/tree/css_import_node.rb', line 10
def uri
@uri
end
|
Class Method Details
.resolved(uri) ⇒ CssImportNode
41 42 43 44 45 |
# File 'lib/sass/tree/css_import_node.rb', line 41
def self.resolved(uri)
node = new(uri)
node.resolved_uri = uri
node
end
|
Instance Method Details
#resolved_value
51 52 53 54 55 56 57 58 |
# File 'lib/sass/tree/css_import_node.rb', line 51
def resolved_value
@resolved_value ||=
begin
str = "@import #{resolved_uri}"
str << " #{resolved_query.to_css}" if resolved_query
str
end
end
|
#value
48 |
# File 'lib/sass/tree/css_import_node.rb', line 48
def value; raise NotImplementedError; end
|