Class: Sass::Tree::CssImportNode

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

Overview

A node representing an @import rule that's importing plain CSS.

See Also:

Instance Attribute Summary collapse

Attributes inherited from DirectiveNode

#group_end, #tabs

Attributes inherited from Node

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

Class Method Summary collapse

Instance Method Summary collapse

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 = []) ⇒ CssImportNode

Returns a new instance of CssImportNode

Parameters:



33
34
35
36
37
# File 'lib/sass/tree/css_import_node.rb', line 33

def initialize(uri, query = [])
  @uri = uri
  @query = query
  super('')
end

Instance Attribute Details

#queryArray<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.

Returns:



23
24
25
# File 'lib/sass/tree/css_import_node.rb', line 23

def query
  @query
end

#resolved_querySass::Media::QueryList

The media query for this rule, without any unresolved interpolation. It's only set once Visitors::Perform has been run.



29
30
31
# File 'lib/sass/tree/css_import_node.rb', line 29

def resolved_query
  @resolved_query
end

#resolved_uriString

The text of the URI being imported after any interpolated SassScript has been resolved. Only set once Visitors::Perform has been run.

Returns:

  • (String)


16
17
18
# File 'lib/sass/tree/css_import_node.rb', line 16

def resolved_uri
  @resolved_uri
end

#uriString, Sass::Script::Tree::Node

The URI being imported, either as a plain string or an interpolated script string.

Returns:



10
11
12
# File 'lib/sass/tree/css_import_node.rb', line 10

def uri
  @uri
end

Class Method Details

.resolved(uri) ⇒ CssImportNode

Parameters:

Returns:



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

Raises:

  • (NotImplementedError)

See Also:



48
# File 'lib/sass/tree/css_import_node.rb', line 48

def value; raise NotImplementedError; end