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::Tree::Node>
The media query for this rule, interspersed with Script::Tree::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.
-
#supports_condition ⇒ Sass::Supports::Condition
The supports condition for this import.
-
#uri ⇒ String, Sass::Script::Tree::Node
The URI being imported, either as a plain string or an interpolated script string.
Attributes inherited from DirectiveNode
Attributes inherited from Node
#children, #filename, #has_children, #line, #options, #source_range
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uri, query = [], supports_condition = nil) ⇒ CssImportNode
constructor
A new instance of CssImportNode.
- #resolved_value
- #value
Methods inherited from DirectiveNode
#bubbles?, #name, #normalized_name
Methods inherited from Node
#<<, #==, #balance, #bubbles?, #css, #css_with_sourcemap, #deep_copy, #each, #inspect, #invisible?, #style, #to_sass, #to_scss
Constructor Details
#initialize(uri, query = [], supports_condition = nil) ⇒ CssImportNode
Returns a new instance of CssImportNode.
39 40 41 42 43 44 |
# File 'lib/sass/tree/css_import_node.rb', line 39
def initialize(uri, query = [], supports_condition = nil)
@uri = uri
@query = query
@supports_condition = supports_condition
super('')
end
|
Instance Attribute Details
#query ⇒ Array<String, Sass::Script::Tree::Node>
The media query for this rule, interspersed with
Script::Tree::Nodes representing #{}
-interpolation. Any adjacent
strings will be merged together.
28 29 30 |
# File 'lib/sass/tree/css_import_node.rb', line 28
def query
@query
end
|
#resolved_query ⇒ Sass::Media::QueryList
The media query for this rule, without any unresolved interpolation. It's only set once Visitors::Perform has been run.
34 35 36 |
# File 'lib/sass/tree/css_import_node.rb', line 34
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
|
#supports_condition ⇒ Sass::Supports::Condition
The supports condition for this import.
21 22 23 |
# File 'lib/sass/tree/css_import_node.rb', line 21
def supports_condition
@supports_condition
end
|
#uri ⇒ String, Sass::Script::Tree::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
48 49 50 51 52 |
# File 'lib/sass/tree/css_import_node.rb', line 48
def self.resolved(uri)
node = new(uri)
node.resolved_uri = uri
node
end
|
Instance Method Details
#resolved_value
58 59 60 61 62 63 64 65 66 |
# File 'lib/sass/tree/css_import_node.rb', line 58
def resolved_value
@resolved_value ||=
begin
str = "@import #{resolved_uri}"
str << " supports(#{supports_condition.to_css})" if supports_condition
str << " #{resolved_query.to_css}" if resolved_query
str
end
end
|
#value
55 |
# File 'lib/sass/tree/css_import_node.rb', line 55
def value; raise NotImplementedError; end
|