diff --git a/TODO b/TODO index 53401176..830bd408 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,6 @@ Testing: Test html2haml + Test Sassy import Documentation: Haml::Engine public method documentation could use work @@ -14,4 +15,4 @@ Features: "%li, %a"? Sass::Engine load_paths option should be set by executable Errors in imported files should point to the proper files. - Sassy CSS imports should compile to a literal CSS "@import" + meta, br, etc. tags should be automatically self-closed. diff --git a/lib/sass/engine.rb b/lib/sass/engine.rb index 3b762c2d..113d3127 100644 --- a/lib/sass/engine.rb +++ b/lib/sass/engine.rb @@ -268,13 +268,18 @@ module Sass files.split(/,\s*/).each do |filename| engine = nil - File.open(find_file_to_import(filename)) do |file| - engine = Sass::Engine.new(file.read) - end + filename = find_file_to_import(filename) + if filename =~ /\.css$/ + nodes << Tree::ValueNode.new("@import #{filename}", @options[:style]) + else + File.open(filename) do |file| + engine = Sass::Engine.new(file.read, @options) + end - root = engine.render_to_tree - nodes += root.children - @constants.merge! engine.constants + root = engine.render_to_tree + nodes += root.children + @constants.merge! engine.constants + end end nodes diff --git a/lib/sass/tree/value_node.rb b/lib/sass/tree/value_node.rb index 30adf202..1c3fa771 100644 --- a/lib/sass/tree/value_node.rb +++ b/lib/sass/tree/value_node.rb @@ -8,5 +8,9 @@ module Sass::Tree @value = value super(style) end + + def to_s(parent = nil) + value + end end end