1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Sassy import properly imports CSS documents.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@446 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-03-25 04:34:55 +00:00
parent 79f3f71b62
commit 1e8fb0e8d6
3 changed files with 17 additions and 7 deletions

3
TODO
View file

@ -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.

View file

@ -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

View file

@ -8,5 +8,9 @@ module Sass::Tree
@value = value
super(style)
end
def to_s(parent = nil)
value
end
end
end