GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Sass: "&:foo, bar" in a selector is the same as "&:foo, & bar".


git-svn-id: svn://hamptoncatlin.com/haml/trunk@534 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Fri Jun 22 13:03:56 -0700 2007
commit  96f8800d71e41f87e1cd187e0be1f562cf185ceb
tree    cc128ccb6fee658acf2f859af9d1ce281fca025f
parent  3a77acb1dc1adc727ee990ccf99f58ef3fa25a5e
0
...
1
2
3
4
5
6
7
...
1
2
 
 
3
4
5
0
@@ -1,7 +1,5 @@
0
 Bugs:
0
   If an @imported document is changed, Sass should recompile the template
0
- == #{"Foo"} doesn't work in Haml
0
- "&.foo, bar" in Sass should read as "&.foo, & bar"
0
 
0
 Testing:
0
   Test html2haml and css2sass
...
12
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
 
 
23
24
 
25
26
27
...
12
13
14
 
15
16
 
 
 
 
 
17
18
19
20
21
22
23
24
 
25
26
27
28
0
@@ -12,16 +12,17 @@ module Sass::Tree
0
     def to_s(tabs, super_rules = nil)
0
       attributes = []
0
       sub_rules = []
0
- refs_parent = self.rule.include? PARENT
0
       total_rule = if super_rules
0
         super_rules.split(/,\s*/).collect! do |s|
0
- if refs_parent
0
- self.rule.gsub(PARENT, s)
0
- else
0
- self.rule.split(/,\s*/).collect {|r| "#{s} #{r}"}.join(", ")
0
- end
0
+ self.rule.split(/,\s*/).collect do |r|
0
+ if r.include?(PARENT)
0
+ r.gsub(PARENT, s)
0
+ else
0
+ "#{s} #{r}"
0
+ end
0
+ end.join(", ")
0
         end.join(", ")
0
- elsif refs_parent
0
+ elsif self.rule.include?(PARENT)
0
         raise Sass::SyntaxError.new("Base-level rules cannot contain the parent-selector-referencing character '#{PARENT}'", line)
0
       else
0
         self.rule
...
3
4
5
 
6
7
8
...
3
4
5
6
7
8
9
0
@@ -3,6 +3,7 @@ a:hover { color: #f00; }
0
 
0
 p, div { width: 100em; }
0
 p foo, div foo { width: 10em; }
0
+p:hover, p bar, div:hover, div bar { height: 20em; }
0
 
0
 #cool { border-style: solid; border-width: 2em; }
0
 .ie7 #cool, .ie6 #cool { content: string(Totally not cool.); }
...
7
8
9
 
 
10
11
12
...
7
8
9
10
11
12
13
14
0
@@ -7,6 +7,8 @@ p, div
0
   :width 100em
0
   & foo
0
     :width 10em
0
+ &:hover, bar
0
+ :height 20em
0
 
0
 #cool
0
   :border

Comments

    No one has commented yet.