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:
parent
79f3f71b62
commit
1e8fb0e8d6
3 changed files with 17 additions and 7 deletions
3
TODO
3
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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,5 +8,9 @@ module Sass::Tree
|
|||
@value = value
|
||||
super(style)
|
||||
end
|
||||
|
||||
def to_s(parent = nil)
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue