class Sass::Tree::ImportNode
to the backtrace if an error occurs.
It doesn’t have a functional purpose other than to add the ‘@import`ed file
A static node that wraps the {Sass::Tree} for an `@import`ed file.
def css_import?
-
(Boolean)
- Whether or not this is a simple CSS @import declaration.
def css_import? if @imported_filename =~ /\.css$/ @imported_filename elsif imported_file.is_a?(String) && imported_file =~ /\.css$/ imported_file end end
def import
def import paths = @options[:load_paths] if @options[:importer] f = @options[:importer].find_relative( @imported_filename, @options[:filename], @options.dup) return f if f end paths.each do |p| if f = p.find(@imported_filename, @options.dup) return f end end message = "File to import not found or unreadable: #{@imported_filename}.\n" if paths.size == 1 message << "Load path: #{paths.first}" else message << "Load paths:\n " << paths.join("\n ") end raise SyntaxError.new(message) rescue SyntaxError => e raise SyntaxError.new(e.message, :line => self.line, :filename => @filename) end
def imported_file
-
(Sass::SyntaxError)
- If no file could be found to import.
Returns:
-
(Sass::Engine)
-
def imported_file @imported_file ||= import end
def initialize(imported_filename)
-
imported_filename
(String
) -- The name of the imported file
def initialize(imported_filename) @imported_filename = imported_filename super(nil) end
def invisible?; to_s.empty?; end
def invisible?; to_s.empty?; end