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
Search Repo:
changed mixin definition character from '-' to '='
Garry Hill (author)
Wed Apr 16 07:13:55 -0700 2008
nex3 (committer)
Wed Apr 16 19:38:29 -0700 2008
commit  62b4cbf6c2995f1b2a3cfff36a4c0229f5effb1b
tree    207268a3d531baa9387942eaca4edeb6a683bd13
parent  0f74ca64ed818955d1100b225119ec17117a4a3f
...
232
233
234
235
 
236
237
238
...
232
233
234
 
235
236
237
238
0
@@ -232,7 +232,7 @@
0
 These let you group whole swathes of CSS attributes into a single
0
 directive and then include those anywhere you want:
0
 
0
--blue-border
0
+=blue-border
0
   :border
0
     :color blue
0
     :width 2px
...
606
607
608
609
 
610
611
612
613
614
615
 
 
616
617
618
619
 
620
621
622
623
624
...
659
660
661
662
 
663
664
665
 
666
667
668
669
 
670
671
672
...
606
607
608
 
609
610
611
612
613
614
615
616
617
618
619
620
 
621
622
623
624
625
626
...
661
662
663
 
664
665
666
 
667
668
669
670
 
671
672
673
674
0
@@ -606,17 +606,19 @@
0
 # To define a mixin you use a slightly modified form of selector syntax.
0
 # For example the 'large-text' mixin is defined as follows:
0
 #
0
-# -large-text
0
+# =large-text
0
 # :font
0
 # :family Arial
0
 # :size 20px
0
 # :weight bold
0
 # :color #ff0000
0
 #
0
+# The initial '=' marks this as a mixin rather than a standard selector.
0
+# The CSS rules that follow won't be included until the mixin is referenced later on.
0
 # Anything you can put into a standard selector,
0
 # you can put into a mixin definition. e.g.
0
 #
0
-# -clearfix
0
+# =clearfix
0
 # display: inline-block
0
 # &:after
0
 # content: "."
0
0
0
@@ -659,14 +661,14 @@
0
 # Mixin definitions can also include references to other mixins defined earlier in the file.
0
 # E.g.
0
 #
0
-# -highlighted-background
0
+# =highlighted-background
0
 # background:
0
 # color: #fc0
0
-# -header-text
0
+# =header-text
0
 # font:
0
 # size: 20px
0
 #
0
-# -compound
0
+# =compound
0
 # +highlighted-background
0
 # +header-text
0
 #
...
44
45
46
47
 
48
49
50
...
44
45
46
 
47
48
49
50
0
@@ -44,7 +44,7 @@
0
     ESCAPE_CHAR = ?\\
0
 
0
     # Designates block as mixin definition rather than CSS rules to output
0
- MIXIN_DEFINITION_CHAR = ?-
0
+ MIXIN_DEFINITION_CHAR = ?=
0
 
0
     # Includes named mixin declared using MIXIN_DEFINITION_CHAR
0
     MIXIN_INCLUDE_CHAR = ?+
...
48
49
50
51
52
53
 
 
 
54
55
56
...
48
49
50
 
 
 
51
52
53
54
55
56
0
@@ -48,9 +48,9 @@
0
     "foo\n @import templates/basic" => "Import directives may only be used at the root of a document.",
0
     "!foo = bar baz !" => "Unterminated constant.",
0
     "!foo = !(foo)" => "Invalid constant.",
0
- "-foo\n :color red\n.bar\n +bang" => "Undefined mixin 'bang'",
0
- ".bar\n -foo\n :color red\n" => "Mixins may only be defined at the root of a document.",
0
- "-foo\n :color red\n.bar\n +foo\n :color red" => "Illegal nesting: Nothing may be nested beneath mixin directives.",
0
+ "=foo\n :color red\n.bar\n +bang" => "Undefined mixin 'bang'",
0
+ ".bar\n =foo\n :color red\n" => "Mixins may only be defined at the root of a document.",
0
+ "=foo\n :color red\n.bar\n +foo\n :color red" => "Illegal nesting: Nothing may be nested beneath mixin directives.",
0
   }
0
   
0
   def test_basic_render
...
7
8
9
 
10
11
12
...
19
20
21
 
22
23
24
...
29
30
31
 
32
33
34
...
39
40
41
 
42
43
44
...
64
65
66
 
 
67
68
69
...
85
86
87
 
88
...
7
8
9
10
11
12
13
...
20
21
22
23
24
25
26
...
31
32
33
34
35
36
37
...
42
43
44
45
46
47
48
...
68
69
70
71
72
73
74
75
...
91
92
93
94
95
0
@@ -7,6 +7,7 @@
0
   border-top-color: #ffcc00;
0
   border-left-width: 1px;
0
   border-left-color: #000;
0
+ -moz-border-radius: 10px;
0
   border-style: dotted;
0
   border-width: 2px;
0
 }
0
@@ -19,6 +20,7 @@
0
   border-top-color: #ffcc00;
0
   border-left-width: 1px;
0
   border-left-color: #000;
0
+ -moz-border-radius: 10px;
0
   font-size: 2em;
0
   font-weight: bold;
0
   float: left;
0
@@ -29,6 +31,7 @@
0
   border-top-color: #ffcc00;
0
   border-left-width: 1px;
0
   border-left-color: #000;
0
+ -moz-border-radius: 10px;
0
   color: #f00;
0
   font-size: 20px;
0
   float: right;
0
@@ -39,6 +42,7 @@
0
   border-top-color: #ffcc00;
0
   border-left-width: 1px;
0
   border-left-color: #000;
0
+ -moz-border-radius: 10px;
0
 }
0
 
0
 .complex {
0
@@ -64,6 +68,8 @@
0
   font-size: 20px;
0
   text-decoration: none;
0
   display: inline;
0
+ -webkit-nonsense-top-right: 1px;
0
+ -webkit-nonsense-bottom-left: 1px;
0
 }
0
 .more-complex:after {
0
   content: ".";
0
@@ -85,5 +91,6 @@
0
   border-top-color: #ffcc00;
0
   border-left-width: 1px;
0
   border-left-color: #000;
0
+ -moz-border-radius: 10px;
0
 }
...
1
2
3
 
4
5
6
7
8
...
8
9
10
11
 
 
 
12
13
14
15
16
 
17
18
19
20
 
21
22
23
...
30
31
32
33
 
34
35
36
...
69
70
71
 
 
 
...
1
2
 
3
4
5
6
7
8
...
8
9
10
 
11
12
13
14
15
16
17
 
18
19
20
21
 
22
23
24
25
...
32
33
34
 
35
36
37
38
...
71
72
73
74
75
76
0
@@ -1,6 +1,6 @@
0
 !yellow = #fc0
0
 
0
--bordered
0
+=bordered
0
   :border
0
     :top
0
       :width 2px
0
0
0
@@ -8,16 +8,18 @@
0
     :left
0
       :width 1px
0
       :color #000
0
--header-font
0
+ -moz-border-radius: 10px
0
+
0
+=header-font
0
   :color #f00
0
   :font
0
     :size 20px
0
 
0
--compound
0
+=compound
0
   +header-font
0
   +bordered
0
 
0
--complex
0
+=complex
0
   +header-font
0
   text:
0
     decoration: none
0
@@ -30,7 +32,7 @@
0
   * html &
0
     height: 1px
0
     +header-font
0
--deep
0
+=deep
0
   a:hover
0
     :text-decoration underline
0
     +compound
0
@@ -69,4 +71,7 @@
0
   +complex
0
   +deep
0
   display: inline
0
+ -webkit-nonsense:
0
+ top-right: 1px
0
+ bottom-left: 1px

Comments

    No one has commented yet.