Class Sass::Tree::ImportNode
In: lib/sass/tree/import_node.rb
Parent: Node

A static node that wraps the {Sass::Tree} for an `@import`ed file. It doesn‘t have a functional purpose other than to add the `@import`ed file to the backtrace if an error occurs.

Methods

invisible?   new   perform!   to_s  

Public Class methods

@param imported_filename [String] The name of the imported file

[Source]

    # File lib/sass/tree/import_node.rb, line 8
 8:       def initialize(imported_filename)
 9:         @imported_filename = imported_filename
10:         super()
11:       end

Public Instance methods

[Source]

    # File lib/sass/tree/import_node.rb, line 23
23:       def invisible?; to_s.empty?; end

Computes the CSS for the imported file.

@param args [Array] Ignored

[Source]

    # File lib/sass/tree/import_node.rb, line 16
16:       def to_s(*args)
17:         @to_s ||= (style == :compressed ? super().strip : super())
18:       rescue Sass::SyntaxError => e
19:         e.add_backtrace_entry(@filename)
20:         raise e
21:       end

Protected Instance methods

Parses the imported file and runs the dynamic Sass for it.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values

[Source]

    # File lib/sass/tree/import_node.rb, line 32
32:       def perform!(environment)
33:         return unless full_filename = import
34:         self.children = Sass::Files.tree_for(full_filename, @options).children
35:         self.children = perform_children(environment)
36:       rescue Sass::SyntaxError => e
37:         e.add_backtrace_entry(@filename)
38:         raise e
39:       end

[Validate]