Module: Less::StyleSheet::Import1
- Defined in:
- lib/sass/less.rb
Overview
Less handles these during parse-time, so we want to wrap them up as a node in the tree. We also include the nodes, though, since we want to have access to the mixins so we can tell if they take arguments or not. The included nodes are hidden so they don't appear in the output.
Instance Method Summary collapse
- #build_with_sass(env) (also: #build)
Instance Method Details
#build_with_sass(env) Also known as: build
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/sass/less.rb', line 105
def build_with_sass(env)
line = input.line_of(interval.first)
import = Sass::Tree::ImportNode.new(url.value.gsub(/\.less$/, ''))
import.line = input.line_of(interval.first)
env << Node::SassNode.new(import)
old_rules = env.rules.dup
build_without_sass env
(env.rules - old_rules).each {|r| r.hide_in_sass = true}
rescue ImportError => e
raise Sass::SyntaxError.new("File to import #{url.text_value} not found or unreadable", :line => line)
end
|