haml 3.1.0.alpha.14 → 3.1.0.alpha.17

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

Files changed (222) hide show
  1. data/EDGE_GEM_VERSION +1 -1
  2. data/VERSION +1 -1
  3. data/lib/haml.rb +3 -2
  4. data/lib/haml/exec.rb +0 -226
  5. data/lib/sass.rb +8 -0
  6. data/lib/sass/plugin.rb +8 -0
  7. data/lib/sass/rails2_shim.rb +9 -0
  8. data/lib/sass/rails3_shim.rb +16 -0
  9. data/vendor/sass/CONTRIBUTING +3 -0
  10. data/vendor/sass/MIT-LICENSE +20 -0
  11. data/vendor/sass/README.md +201 -0
  12. data/vendor/sass/Rakefile +363 -0
  13. data/vendor/sass/TODO +39 -0
  14. data/vendor/sass/VERSION +1 -0
  15. data/vendor/sass/VERSION_NAME +1 -0
  16. data/vendor/sass/bin/css2sass +13 -0
  17. data/vendor/sass/bin/sass +8 -0
  18. data/vendor/sass/bin/sass-convert +7 -0
  19. data/vendor/sass/doc-src/FAQ.md +35 -0
  20. data/vendor/sass/doc-src/INDENTED_SYNTAX.md +210 -0
  21. data/vendor/sass/doc-src/SASS_CHANGELOG.md +1878 -0
  22. data/vendor/sass/doc-src/SASS_REFERENCE.md +1713 -0
  23. data/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md +155 -0
  24. data/vendor/sass/ext/extconf.rb +10 -0
  25. data/vendor/sass/extra/update_watch.rb +13 -0
  26. data/vendor/sass/init.rb +18 -0
  27. data/vendor/sass/lib/sass.rb +71 -0
  28. data/vendor/sass/lib/sass/cache_store.rb +208 -0
  29. data/vendor/sass/lib/sass/callbacks.rb +66 -0
  30. data/vendor/sass/lib/sass/css.rb +294 -0
  31. data/vendor/sass/lib/sass/engine.rb +792 -0
  32. data/vendor/sass/lib/sass/environment.rb +143 -0
  33. data/vendor/sass/lib/sass/error.rb +201 -0
  34. data/vendor/sass/lib/sass/exec.rb +619 -0
  35. data/vendor/sass/lib/sass/importers.rb +22 -0
  36. data/vendor/sass/lib/sass/importers/base.rb +138 -0
  37. data/vendor/sass/lib/sass/importers/filesystem.rb +121 -0
  38. data/vendor/sass/lib/sass/less.rb +363 -0
  39. data/vendor/sass/lib/sass/plugin.rb +126 -0
  40. data/vendor/sass/lib/sass/plugin/compiler.rb +346 -0
  41. data/vendor/sass/lib/sass/plugin/configuration.rb +123 -0
  42. data/vendor/sass/lib/sass/plugin/generic.rb +15 -0
  43. data/vendor/sass/lib/sass/plugin/merb.rb +48 -0
  44. data/vendor/sass/lib/sass/plugin/rack.rb +47 -0
  45. data/vendor/sass/lib/sass/plugin/rails.rb +41 -0
  46. data/vendor/sass/lib/sass/plugin/staleness_checker.rb +145 -0
  47. data/vendor/sass/lib/sass/railtie.rb +8 -0
  48. data/vendor/sass/lib/sass/repl.rb +58 -0
  49. data/vendor/sass/lib/sass/root.rb +7 -0
  50. data/vendor/sass/lib/sass/script.rb +63 -0
  51. data/vendor/sass/lib/sass/script/bool.rb +18 -0
  52. data/vendor/sass/lib/sass/script/color.rb +491 -0
  53. data/vendor/sass/lib/sass/script/css_lexer.rb +29 -0
  54. data/vendor/sass/lib/sass/script/css_parser.rb +31 -0
  55. data/vendor/sass/lib/sass/script/funcall.rb +76 -0
  56. data/vendor/sass/lib/sass/script/functions.rb +852 -0
  57. data/vendor/sass/lib/sass/script/interpolation.rb +70 -0
  58. data/vendor/sass/lib/sass/script/lexer.rb +337 -0
  59. data/vendor/sass/lib/sass/script/literal.rb +236 -0
  60. data/vendor/sass/lib/sass/script/node.rb +112 -0
  61. data/vendor/sass/lib/sass/script/number.rb +423 -0
  62. data/vendor/sass/lib/sass/script/operation.rb +90 -0
  63. data/vendor/sass/lib/sass/script/parser.rb +392 -0
  64. data/vendor/sass/lib/sass/script/string.rb +67 -0
  65. data/vendor/sass/lib/sass/script/string_interpolation.rb +93 -0
  66. data/vendor/sass/lib/sass/script/unary_operation.rb +57 -0
  67. data/vendor/sass/lib/sass/script/variable.rb +48 -0
  68. data/vendor/sass/lib/sass/scss.rb +17 -0
  69. data/vendor/sass/lib/sass/scss/css_parser.rb +51 -0
  70. data/vendor/sass/lib/sass/scss/parser.rb +838 -0
  71. data/vendor/sass/lib/sass/scss/rx.rb +126 -0
  72. data/vendor/sass/lib/sass/scss/sass_parser.rb +11 -0
  73. data/vendor/sass/lib/sass/scss/script_lexer.rb +15 -0
  74. data/vendor/sass/lib/sass/scss/script_parser.rb +25 -0
  75. data/vendor/sass/lib/sass/scss/static_parser.rb +40 -0
  76. data/vendor/sass/lib/sass/selector.rb +361 -0
  77. data/vendor/sass/lib/sass/selector/abstract_sequence.rb +62 -0
  78. data/vendor/sass/lib/sass/selector/comma_sequence.rb +82 -0
  79. data/vendor/sass/lib/sass/selector/sequence.rb +236 -0
  80. data/vendor/sass/lib/sass/selector/simple.rb +113 -0
  81. data/vendor/sass/lib/sass/selector/simple_sequence.rb +135 -0
  82. data/vendor/sass/lib/sass/shared.rb +78 -0
  83. data/vendor/sass/lib/sass/tree/comment_node.rb +128 -0
  84. data/vendor/sass/lib/sass/tree/debug_node.rb +36 -0
  85. data/vendor/sass/lib/sass/tree/directive_node.rb +75 -0
  86. data/vendor/sass/lib/sass/tree/extend_node.rb +65 -0
  87. data/vendor/sass/lib/sass/tree/for_node.rb +67 -0
  88. data/vendor/sass/lib/sass/tree/if_node.rb +81 -0
  89. data/vendor/sass/lib/sass/tree/import_node.rb +124 -0
  90. data/vendor/sass/lib/sass/tree/mixin_def_node.rb +60 -0
  91. data/vendor/sass/lib/sass/tree/mixin_node.rb +123 -0
  92. data/vendor/sass/lib/sass/tree/node.rb +490 -0
  93. data/vendor/sass/lib/sass/tree/prop_node.rb +220 -0
  94. data/vendor/sass/lib/sass/tree/root_node.rb +125 -0
  95. data/vendor/sass/lib/sass/tree/rule_node.rb +273 -0
  96. data/vendor/sass/lib/sass/tree/variable_node.rb +39 -0
  97. data/vendor/sass/lib/sass/tree/warn_node.rb +42 -0
  98. data/vendor/sass/lib/sass/tree/while_node.rb +48 -0
  99. data/vendor/sass/lib/sass/util.rb +700 -0
  100. data/vendor/sass/lib/sass/util/subset_map.rb +101 -0
  101. data/vendor/sass/lib/sass/version.rb +109 -0
  102. data/vendor/sass/rails/init.rb +1 -0
  103. data/vendor/sass/sass.gemspec +32 -0
  104. data/vendor/sass/test/sass/cache_test.rb +74 -0
  105. data/vendor/sass/test/sass/callbacks_test.rb +61 -0
  106. data/vendor/sass/test/sass/conversion_test.rb +1210 -0
  107. data/vendor/sass/test/sass/css2sass_test.rb +364 -0
  108. data/vendor/sass/test/sass/data/hsl-rgb.txt +319 -0
  109. data/vendor/sass/test/sass/engine_test.rb +2305 -0
  110. data/vendor/sass/test/sass/extend_test.rb +1348 -0
  111. data/vendor/sass/test/sass/functions_test.rb +565 -0
  112. data/vendor/sass/test/sass/importer_test.rb +104 -0
  113. data/vendor/sass/test/sass/less_conversion_test.rb +632 -0
  114. data/vendor/sass/test/sass/mock_importer.rb +49 -0
  115. data/vendor/sass/test/sass/more_results/more1.css +9 -0
  116. data/vendor/sass/test/sass/more_results/more1_with_line_comments.css +26 -0
  117. data/vendor/sass/test/sass/more_results/more_import.css +29 -0
  118. data/vendor/sass/test/sass/more_templates/_more_partial.sass +2 -0
  119. data/vendor/sass/test/sass/more_templates/more1.sass +23 -0
  120. data/vendor/sass/test/sass/more_templates/more_import.sass +11 -0
  121. data/vendor/sass/test/sass/plugin_test.rb +430 -0
  122. data/vendor/sass/test/sass/results/alt.css +4 -0
  123. data/vendor/sass/test/sass/results/basic.css +9 -0
  124. data/vendor/sass/test/sass/results/compact.css +5 -0
  125. data/vendor/sass/test/sass/results/complex.css +86 -0
  126. data/vendor/sass/test/sass/results/compressed.css +1 -0
  127. data/vendor/sass/test/sass/results/expanded.css +19 -0
  128. data/vendor/sass/test/sass/results/import.css +31 -0
  129. data/vendor/sass/test/sass/results/line_numbers.css +49 -0
  130. data/vendor/sass/test/sass/results/mixins.css +95 -0
  131. data/vendor/sass/test/sass/results/multiline.css +24 -0
  132. data/vendor/sass/test/sass/results/nested.css +22 -0
  133. data/vendor/sass/test/sass/results/options.css +1 -0
  134. data/vendor/sass/test/sass/results/parent_ref.css +13 -0
  135. data/vendor/sass/test/sass/results/script.css +16 -0
  136. data/vendor/sass/test/sass/results/scss_import.css +31 -0
  137. data/vendor/sass/test/sass/results/scss_importee.css +2 -0
  138. data/vendor/sass/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  139. data/vendor/sass/test/sass/results/subdir/subdir.css +3 -0
  140. data/vendor/sass/test/sass/results/units.css +11 -0
  141. data/vendor/sass/test/sass/results/warn.css +0 -0
  142. data/vendor/sass/test/sass/results/warn_imported.css +0 -0
  143. data/vendor/sass/test/sass/script_conversion_test.rb +254 -0
  144. data/vendor/sass/test/sass/script_test.rb +470 -0
  145. data/vendor/sass/test/sass/scss/css_test.rb +897 -0
  146. data/vendor/sass/test/sass/scss/rx_test.rb +156 -0
  147. data/vendor/sass/test/sass/scss/scss_test.rb +1088 -0
  148. data/vendor/sass/test/sass/scss/test_helper.rb +37 -0
  149. data/vendor/sass/test/sass/templates/_partial.sass +2 -0
  150. data/vendor/sass/test/sass/templates/alt.sass +16 -0
  151. data/vendor/sass/test/sass/templates/basic.sass +23 -0
  152. data/vendor/sass/test/sass/templates/bork1.sass +2 -0
  153. data/vendor/sass/test/sass/templates/bork2.sass +2 -0
  154. data/vendor/sass/test/sass/templates/bork3.sass +2 -0
  155. data/vendor/sass/test/sass/templates/bork4.sass +2 -0
  156. data/vendor/sass/test/sass/templates/compact.sass +17 -0
  157. data/vendor/sass/test/sass/templates/complex.sass +305 -0
  158. data/vendor/sass/test/sass/templates/compressed.sass +15 -0
  159. data/vendor/sass/test/sass/templates/expanded.sass +17 -0
  160. data/vendor/sass/test/sass/templates/import.sass +12 -0
  161. data/vendor/sass/test/sass/templates/importee.less +2 -0
  162. data/vendor/sass/test/sass/templates/importee.sass +19 -0
  163. data/vendor/sass/test/sass/templates/line_numbers.sass +13 -0
  164. data/vendor/sass/test/sass/templates/mixin_bork.sass +5 -0
  165. data/vendor/sass/test/sass/templates/mixins.sass +76 -0
  166. data/vendor/sass/test/sass/templates/multiline.sass +20 -0
  167. data/vendor/sass/test/sass/templates/nested.sass +25 -0
  168. data/vendor/sass/test/sass/templates/nested_bork1.sass +2 -0
  169. data/vendor/sass/test/sass/templates/nested_bork2.sass +2 -0
  170. data/vendor/sass/test/sass/templates/nested_bork3.sass +2 -0
  171. data/vendor/sass/test/sass/templates/nested_bork4.sass +2 -0
  172. data/vendor/sass/test/sass/templates/nested_mixin_bork.sass +6 -0
  173. data/vendor/sass/test/sass/templates/options.sass +2 -0
  174. data/vendor/sass/test/sass/templates/parent_ref.sass +25 -0
  175. data/vendor/sass/test/sass/templates/script.sass +101 -0
  176. data/vendor/sass/test/sass/templates/scss_import.scss +11 -0
  177. data/vendor/sass/test/sass/templates/scss_importee.scss +1 -0
  178. data/vendor/sass/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
  179. data/vendor/sass/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  180. data/vendor/sass/test/sass/templates/subdir/subdir.sass +6 -0
  181. data/vendor/sass/test/sass/templates/units.sass +11 -0
  182. data/vendor/sass/test/sass/templates/warn.sass +3 -0
  183. data/vendor/sass/test/sass/templates/warn_imported.sass +4 -0
  184. data/vendor/sass/test/sass/test_helper.rb +8 -0
  185. data/vendor/sass/test/sass/util/subset_map_test.rb +91 -0
  186. data/vendor/sass/test/sass/util_test.rb +275 -0
  187. data/vendor/sass/test/test_helper.rb +64 -0
  188. data/vendor/sass/vendor/fssm/LICENSE +20 -0
  189. data/vendor/sass/vendor/fssm/README.markdown +55 -0
  190. data/vendor/sass/vendor/fssm/Rakefile +59 -0
  191. data/vendor/sass/vendor/fssm/VERSION.yml +5 -0
  192. data/vendor/sass/vendor/fssm/example.rb +9 -0
  193. data/vendor/sass/vendor/fssm/fssm.gemspec +77 -0
  194. data/vendor/sass/vendor/fssm/lib/fssm.rb +33 -0
  195. data/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb +36 -0
  196. data/vendor/sass/vendor/fssm/lib/fssm/backends/inotify.rb +26 -0
  197. data/vendor/sass/vendor/fssm/lib/fssm/backends/polling.rb +25 -0
  198. data/vendor/sass/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +131 -0
  199. data/vendor/sass/vendor/fssm/lib/fssm/monitor.rb +26 -0
  200. data/vendor/sass/vendor/fssm/lib/fssm/path.rb +91 -0
  201. data/vendor/sass/vendor/fssm/lib/fssm/pathname.rb +502 -0
  202. data/vendor/sass/vendor/fssm/lib/fssm/state/directory.rb +57 -0
  203. data/vendor/sass/vendor/fssm/lib/fssm/state/file.rb +24 -0
  204. data/vendor/sass/vendor/fssm/lib/fssm/support.rb +63 -0
  205. data/vendor/sass/vendor/fssm/lib/fssm/tree.rb +176 -0
  206. data/vendor/sass/vendor/fssm/profile/prof-cache.rb +40 -0
  207. data/vendor/sass/vendor/fssm/profile/prof-fssm-pathname.html +1231 -0
  208. data/vendor/sass/vendor/fssm/profile/prof-pathname.rb +68 -0
  209. data/vendor/sass/vendor/fssm/profile/prof-plain-pathname.html +988 -0
  210. data/vendor/sass/vendor/fssm/profile/prof.html +2379 -0
  211. data/vendor/sass/vendor/fssm/spec/path_spec.rb +75 -0
  212. data/vendor/sass/vendor/fssm/spec/root/duck/quack.txt +0 -0
  213. data/vendor/sass/vendor/fssm/spec/root/file.css +0 -0
  214. data/vendor/sass/vendor/fssm/spec/root/file.rb +0 -0
  215. data/vendor/sass/vendor/fssm/spec/root/file.yml +0 -0
  216. data/vendor/sass/vendor/fssm/spec/root/moo/cow.txt +0 -0
  217. data/vendor/sass/vendor/fssm/spec/spec_helper.rb +14 -0
  218. data/vendor/sass/yard/callbacks.rb +29 -0
  219. data/vendor/sass/yard/default/fulldoc/html/css/common.sass +26 -0
  220. data/vendor/sass/yard/default/layout/html/footer.erb +12 -0
  221. data/vendor/sass/yard/inherited_hash.rb +41 -0
  222. metadata +219 -2
@@ -0,0 +1,210 @@
1
+ # Sass Indented Syntax
2
+
3
+ * Table of contents
4
+ {:toc}
5
+
6
+ Sass's indented syntax (also known simply as "Sass")
7
+ is designed to provide a more concise
8
+ and, for some, more aesthetically appealing alternative
9
+ to the CSS-based SCSS syntax.
10
+ It's not compatible with CSS;
11
+ instead of using `{` and `}` to delimit blocks of styles,
12
+ it uses indentation,
13
+ and instead of using semicolons to separate statements it uses newlines.
14
+ This usually leads to substantially less text
15
+ when saying the same thing.
16
+
17
+ Each statement in Sass, such as property declarations and selectors,
18
+ must be placed on its own line.
19
+ In addition, everything that would be within `{` and `}` after a statement
20
+ must be on a new line and indented one level deeper than that statement.
21
+ For example, this CSS:
22
+
23
+ #main {
24
+ color: blue;
25
+ font-size: 0.3em;
26
+ }
27
+
28
+ would be this Sass:
29
+
30
+ #main
31
+ color: blue
32
+ font-size: 0.3em
33
+
34
+ Similarly, this SCSS:
35
+
36
+ #main {
37
+ color: blue;
38
+ font-size: 0.3em;
39
+
40
+ a {
41
+ font: {
42
+ weight: bold;
43
+ family: serif;
44
+ }
45
+ &:hover {
46
+ background-color: #eee;
47
+ }
48
+ }
49
+ }
50
+
51
+ would be this Sass:
52
+
53
+ #main
54
+ color: blue
55
+ font-size: 0.3em
56
+
57
+ a
58
+ font:
59
+ weight: bold
60
+ family: serif
61
+ &:hover
62
+ background-color: #eee
63
+
64
+ ## Sass Syntax Differences
65
+
66
+ In general, most CSS and SCSS syntax
67
+ works straightforwardly in Sass
68
+ by using newlines instead of semicolons
69
+ and indentation instead of braces.
70
+ However, there are some cases where there are differences or subtleties,
71
+ which are detailed below.
72
+
73
+ ## Property Synax
74
+
75
+ The indented syntax supports two ways of declaring CSS properties.
76
+ The first is just like CSS, except without the semicolon.
77
+ The second, however, places the colon *before* the property name.
78
+ For example:
79
+
80
+ #main
81
+ :color blue
82
+ :font-size 0.3em
83
+
84
+ By default, both ways may be used.
85
+ However, the {file:SASS_REFERENCE.md#property_syntax-option `:property_syntax` option}
86
+ may be used to specify that only one property syntax is allowed.
87
+
88
+ ### Multiline Selectors
89
+
90
+ Normally in the indented syntax, a single selector must take up a single line.
91
+ There is one exception, however:
92
+ selectors can contain newlines as long as they only appear after commas.
93
+ For example:
94
+
95
+ .users #userTab,
96
+ .posts #postTab
97
+ width: 100px
98
+ height: 30px
99
+
100
+ ### Comments
101
+
102
+ Like everything else in the indented syntax,
103
+ comments are line-based.
104
+ This means that they don't work the same way as in SCSS.
105
+ They must take up an entire line,
106
+ and they also encompass all text nested beneath them.
107
+
108
+ Like SCSS, the indented syntax supports two kinds of comments.
109
+ Comments beginning with `/*` are preserved in the CSS output,
110
+ although unlike SCSS they don't require a closing `*/`.
111
+ Comments beginning with `//` are removed entirely.
112
+ For example:
113
+
114
+ /* This comment will appear in the CSS output.
115
+ This is nested beneath the comment,
116
+ so it's part of it
117
+ body
118
+ color: black
119
+
120
+ // This comment will not appear in the CSS output.
121
+ This is nested beneath the comment as well,
122
+ so it also won't appear
123
+ a
124
+ color: green
125
+
126
+ is compiled to:
127
+
128
+ /* This comment will appear in the CSS output.
129
+ * This is nested beneath the comment,
130
+ * so it's part of it */
131
+ body {
132
+ color: black; }
133
+
134
+ a {
135
+ color: green; }
136
+
137
+ ### `@import`
138
+
139
+ The `@import` directive in Sass does not require quotes, although they may be used.
140
+ For example, this SCSS:
141
+
142
+ @import "themes/dark";
143
+ @import "font.sass";
144
+
145
+ would be this Sass:
146
+
147
+ @import themes/dark
148
+ @import font.sass
149
+
150
+ ### Mixin Directives
151
+
152
+ Sass supports shorthands for the `@mixin` and `@include` directives.
153
+ Instead of writing `@mixin`, you can use the character `=`;
154
+ instead of writing `@include`, you can use the character `+`.
155
+ For example:
156
+
157
+ =large-text
158
+ font:
159
+ family: Arial
160
+ size: 20px
161
+ weight: bold
162
+ color: #ff0000
163
+
164
+ h1
165
+ +large-text
166
+
167
+ is the same as:
168
+
169
+ @mixin large-text
170
+ font:
171
+ family: Arial
172
+ size: 20px
173
+ weight: bold
174
+ color: #ff0000
175
+
176
+ h1
177
+ @include large-text
178
+
179
+ ## Deprecated Syntax
180
+
181
+ Since the indented syntax has been around for a while,
182
+ previous versions have made some syntactic decisions
183
+ that have since been changed.
184
+ Some of the old syntax still works, though,
185
+ so it's documented here.
186
+
187
+ **Note that this syntax is not recommended
188
+ for use in new Sass files**.
189
+ It will print a warning if it's used,
190
+ and it will be removed in a future version.
191
+
192
+ ### `=` for Properties and Variables
193
+
194
+ `=` used to be used instead of `:` when setting variables
195
+ and when setting properties to SassScript values.
196
+ It has slightly different semantics than `:`;
197
+ see {file:SASS_CHANGELOG.md#3-0-0-sass-script-context this changelog entry} for details.
198
+
199
+ ### `||=` for Default Variables
200
+
201
+ `||=` used to be used instead of `:` when setting the default value of a variable.
202
+ The `!default` flag was not used.
203
+ The variable value has the same semantics as `=`;
204
+ see {file:SASS_CHANGELOG.md#3-0-0-sass-script-context this changelog entry} for details.
205
+
206
+ ### `!` Prefix for Variables
207
+
208
+ `!` used to be used as the variable prefix instead of `$`.
209
+ This had no difference in functionality;
210
+ it was a purely aesthetic change.
@@ -0,0 +1,1878 @@
1
+ # Sass Changelog
2
+
3
+ * Table of contents
4
+ {:toc}
5
+
6
+ ## 3.2.0 (Unreleased)
7
+
8
+ * Add an {Sass::Script::Functions#invert `invert` function} that takes the inverse of colors.
9
+
10
+ ### Backwards Incompatibilities -- Must Read!
11
+
12
+ * When `@import` is given a path without `.sass`, `.scss`, or `.css` extension,
13
+ and no file exists at that path, it will now throw an error.
14
+ The old behavior of becoming a plain-CSS `@import` was deprecated
15
+ and has now been removed.
16
+
17
+ * Get rid of the `--rails` flag for the `sass` executable.
18
+ This flag hasn't been necessary since Rails 2.0.
19
+ Existing Rails 2.0 installations will continue to work.
20
+
21
+ ## 3.0.21
22
+
23
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.21).
24
+
25
+ * Fix the permissions errors for good.
26
+
27
+ * Fix more `#options` attribute errors.
28
+
29
+ ## 3.0.20
30
+
31
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.20).
32
+
33
+ * Fix some permissions errors.
34
+
35
+ * Fix `#options` attribute errors when CSS functions were used with commas.
36
+
37
+ ## 3.0.19
38
+
39
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.19).
40
+
41
+ * Make the alpha value for `rgba` colors respect {Sass::Script::Number::PRECISION}.
42
+
43
+ * Remove all newlines in selectors in `:compressed` mode.
44
+
45
+ * Make color names case-insensitive.
46
+
47
+ * Properly detect SCSS files when using `sass -c`.
48
+
49
+ * Remove spaces after commas in `:compressed` mode.
50
+
51
+ * Allow the `--unix-newlines` flag to work on Unix, where it's a no-op.
52
+
53
+ ## 3.0.18
54
+
55
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18).
56
+
57
+ * Don't require `rake` in the gemspec, for bundler compatibility under
58
+ JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog).
59
+
60
+ * Add a command-line option `--stop-on-error` that causes Sass to exit
61
+ when a file fails to compile using `--watch` or `--update`.
62
+
63
+ * Fix a bug in `haml_tag` that would allow duplicate attributes to be added
64
+ and make `data-` attributes not work.
65
+
66
+ * Get rid of the annoying RDoc errors on install.
67
+
68
+ * Disambiguate references to the `Rails` module when `haml-rails` is installed.
69
+
70
+ * Allow `@import` in SCSS to import multiple files in the same `@import` rule.
71
+
72
+ ## 3.0.17
73
+
74
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17).
75
+
76
+ * Disallow `#{}` interpolation in `@media` queries or unrecognized directives.
77
+ This was never allowed, but now it explicitly throws an error
78
+ rather than just producing invalid CSS.
79
+
80
+ * Make `sass --watch` not throw an error when passed a single file or directory.
81
+
82
+ * Understand that mingw counts as Windows.
83
+
84
+ * Make `sass --update` return a non-0 exit code if one or more files being updated
85
+ contained an error.
86
+
87
+ ## 3.0.16
88
+
89
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).
90
+
91
+ * Fix a bug where certain sorts of comments would get improperly
92
+ rendered in the `:compact` style.
93
+
94
+ * Always allow a trailing `*/` in loud comments in the indented syntax.
95
+
96
+ * Fix a performance issue with SCSS parsing in rare cases.
97
+ Thanks to [Chris Eppstein](http://chriseppstein.github.com).
98
+
99
+ * Use better heuristics for figuring out when someone might be using
100
+ the wrong syntax with `sass --watch`.
101
+
102
+ ## 3.0.15
103
+
104
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15).
105
+
106
+ * Fix a bug where `sass --watch` and `sass --update` were completely broken.
107
+
108
+ * Allow `@import`ed values to contain commas.
109
+
110
+ ## 3.0.14
111
+
112
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14).
113
+
114
+ * Properly parse paths with drive letters on Windows (e.g. `C:\Foo\Bar.sass`)
115
+ in the Sass executable.
116
+
117
+ * Compile Sass files in a deterministic order.
118
+
119
+ * Fix a bug where comments after `@if` statements in SCSS
120
+ weren't getting passed through to the output document.
121
+
122
+ ## 3.0.13
123
+
124
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13).
125
+
126
+ ## CSS `@import` Directives
127
+
128
+ Sass is now more intelligent about when to compile `@import` directives to plain CSS.
129
+ Any of the following conditions will cause a literal CSS `@import`:
130
+
131
+ * Importing a path with a `.css` extension (e.g. `@import "foo.css"`).
132
+ * Importing a path with a media type (e.g. `@import "foo" screen;`).
133
+ * Importing an HTTP path (e.g. `@import "http://foo.com/style.css"`).
134
+ * Importing any URL (e.g. `@import url(foo)`).
135
+
136
+ The former two conditions always worked, but the latter two are new.
137
+
138
+ ## `-moz-calc` Support
139
+
140
+ The new [`-moz-calc()` function](http://hacks.mozilla.org/2010/06/css3-calc/) in Firefox 4
141
+ will now be properly parsed by Sass.
142
+ `calc()` was already supported, but because the parsing rules are different
143
+ than for normal CSS functions, this had to be expanded to include `-moz-calc`.
144
+
145
+ In anticipation of wider browser support, in fact,
146
+ *any* function named `-*-calc` (such as `-webkit-calc` or `-ms-calc`)
147
+ will be parsed the same as the `calc` function.
148
+
149
+ ## `:-moz-any` Support
150
+
151
+ The [`:-moz-any` pseudoclass selector](http://hacks.mozilla.org/2010/05/moz-any-selector-grouping/)
152
+ is now parsed by Sass.
153
+
154
+ ## `--require` Flag
155
+
156
+ The Sass command-line executable can now require Ruby files
157
+ using the `--require` flag (or `-r` for short).
158
+
159
+ ## Rails Support
160
+
161
+ Make sure the default Rails options take precedence over the default non-Rails options.
162
+ This makes `./script/server --daemon` work again.
163
+
164
+ ### Rails 3 Support
165
+
166
+ Support for Rails 3 versions prior to beta 4 has been removed.
167
+ Upgrade to Rails 3.0.0.beta4 if you haven't already.
168
+
169
+ ## 3.0.12
170
+
171
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).
172
+
173
+ ## Rails 3 Support
174
+
175
+ Apparently the last version broke in new and exciting ways under Rails 3,
176
+ due to the inconsistent load order caused by certain combinations of gems.
177
+ 3.0.12 hacks around that inconsistency, and *should* be fully Rails 3-compatible.
178
+
179
+ ### Deprecated: Rails 3 Beta 3
180
+
181
+ Haml's support for Rails 3.0.0.beta.3 has been deprecated.
182
+ Haml 3.0.13 will only support 3.0.0.beta.4.
183
+
184
+ ## 3.0.11
185
+
186
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.11).
187
+
188
+ There were no changes made to Haml between versions 3.0.10 and 3.0.11.
189
+
190
+ ## Rails 3 Support
191
+
192
+ Make sure Sass *actually* regenerates stylesheets under Rails 3.
193
+ The fix in 3.0.10 didn't work because the Rack stack we were modifying
194
+ wasn't reloaded at the proper time.
195
+
196
+ ## Bug Fixes
197
+
198
+ * Give a decent error message when `--recursive` is used
199
+ in `sass-convert` without a directory.
200
+
201
+ ## 3.0.10
202
+
203
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.10).
204
+
205
+ ### Appengine-JRuby Support
206
+
207
+ The way we determine the location of the Haml installation
208
+ no longer breaks the version of JRuby
209
+ used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/).
210
+
211
+ ### Rails 3 Support
212
+
213
+ Sass will regenerate stylesheets under Rails 3
214
+ even when no controllers are being accessed.
215
+
216
+ ### Other Improvements
217
+
218
+ * When using `sass-convert --from sass2 --to sass --recursive`,
219
+ suggest the use of `--in-place` as well.
220
+
221
+ ## 3.0.9
222
+
223
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9).
224
+
225
+ There were no changes made to Sass between versions 3.0.8 and 3.0.9.
226
+ A bug in Gemcutter caused the gem to be uploaded improperly.
227
+
228
+ ## 3.0.8
229
+
230
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.8).
231
+
232
+ * Fix a bug with Rails versions prior to Rails 3.
233
+
234
+ ## 3.0.7
235
+
236
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.7).
237
+
238
+ ### Encoding Support
239
+
240
+ Sass 3.0.7 adds support for `@charset` for declaring the encoding of a stylesheet.
241
+ For details see {file:SASS_REFERENCE.md#encodings the reference}.
242
+
243
+ The `sass` and `sass-convert` executables also now take an `-E` option
244
+ for specifying the encoding of Sass/SCSS/CSS files.
245
+
246
+ ### Bug Fixes
247
+
248
+ * When compiling a file named `.sass` but with SCSS syntax specified,
249
+ use the latter (and vice versa).
250
+
251
+ * Fix a bug where interpolation would cause some selectors to render improperly.
252
+
253
+ * If a line in a Sass comment starts with `*foo`,
254
+ render it as `*foo` rather than `* *foo`.
255
+
256
+ ## 3.0.6
257
+
258
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6).
259
+
260
+ There were no changes made to Sass between versions 3.0.5 and 3.0.6.
261
+
262
+ ## 3.0.5
263
+
264
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.5).
265
+
266
+ ### `#{}` Interpolation in Properties
267
+
268
+ Previously, using `#{}` in some places in properties
269
+ would cause a syntax error.
270
+ Now it can be used just about anywhere.
271
+
272
+ Note that when `#{}` is used near operators like `/`,
273
+ those operators are treated as plain CSS
274
+ rather than math operators.
275
+ For example:
276
+
277
+ p {
278
+ $font-size: 12px;
279
+ $line-height: 30px;
280
+ font: #{$font-size}/#{$line-height};
281
+ }
282
+
283
+ is compiled to:
284
+
285
+ p {
286
+ font: 12px/30px;
287
+ }
288
+
289
+ This is useful, since normally {file:SASS_REFERENCE.md#division-and-slash
290
+ a slash with variables is treated as division}.
291
+
292
+ ### Recursive Mixins
293
+
294
+ Mixins that include themselves will now print
295
+ much more informative error messages.
296
+ For example:
297
+
298
+ @mixin foo {@include bar}
299
+ @mixin bar {@include foo}
300
+ @include foo
301
+
302
+ will print:
303
+
304
+ An @include loop has been found:
305
+ foo includes bar
306
+ bar includes foo
307
+
308
+ Although it was previously possible to use recursive mixins
309
+ without causing infinite looping, this is now disallowed,
310
+ since there's no good reason to do it.
311
+
312
+ ### Rails 3 Support
313
+
314
+ Fix Sass configuration under Rails 3.
315
+ Thanks [Dan Cheail](http://github.com/codeape).
316
+
317
+ ### `sass --no-cache`
318
+
319
+ Make the `--no-cache` flag properly forbid Sass from writing `.sass-cache` files.
320
+
321
+ ## 3.0.4
322
+
323
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4).
324
+
325
+ * Raise an informative error when function arguments have a mispaced comma,
326
+ as in `foo(bar, )`.
327
+
328
+ * Fix a performance problem when using long function names
329
+ such as `-moz-linear-gradient`.
330
+
331
+ ## 3.0.3
332
+
333
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.3).
334
+
335
+ ### Rails 3 Support
336
+
337
+ Make sure Sass is loaded properly when using Rails 3
338
+ along with non-Rails-3-compatible plugins like some versions of `will_paginate`.
339
+
340
+ Also, In order to make some Rails loading errors like the above easier to debug,
341
+ Sass will now raise an error if `Rails.root` is `nil` when Sass is loading.
342
+ Previously, this would just cause the paths to be mis-set.
343
+
344
+ ### Merb Support
345
+
346
+ Merb, including 1.1.0 as well as earlier versions,
347
+ should *really* work with this release.
348
+
349
+ ### Bug Fixes
350
+
351
+ * Raise an informative error when mixin arguments have a mispaced comma,
352
+ as in `@include foo(bar, )`.
353
+
354
+ * Make sure SassScript subtraction happens even when nothing else dynamic is going on.
355
+
356
+ * Raise an error when colors are used with the wrong number of digits.
357
+
358
+ ## 3.0.2
359
+
360
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.2).
361
+
362
+ ### Merb 1.1.0 Support
363
+
364
+ Fixed a bug inserting the Sass plugin into the Merb 1.1.0 Rack application.
365
+
366
+ ### Bug Fixes
367
+
368
+ * Allow identifiers to begin with multiple underscores.
369
+
370
+ * Don't raise an error when using `haml --rails` with older Rails versions.
371
+
372
+ ## 3.0.1
373
+
374
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.1).
375
+
376
+ ### Installation in Rails
377
+
378
+ `haml --rails` is no longer necessary for installing Sass in Rails.
379
+ Now all you need to do is add `gem "haml"` to the Gemfile for Rails 3,
380
+ or add `config.gem "haml"` to `config/environment.rb` for previous versions.
381
+
382
+ `haml --rails` will still work,
383
+ but it has been deprecated and will print an error message.
384
+ It will not work in the next version of Sass.
385
+
386
+ ### Rails 3 Beta Integration
387
+
388
+ * Make sure manually importing the Sass Rack plugin still works with Rails,
389
+ even though it's not necessary now.
390
+
391
+ * Allow Sass to be configured in Rails even when it's being lazy-loaded.
392
+
393
+ ### `:template_location` Methods
394
+
395
+ The {file:SASS_REFERENCE.md#template_location-option `:template_location` option}
396
+ can be either a String, a Hash, or an Array.
397
+ This makes it difficult to modify or use with confidence.
398
+ Thus, three new methods have been added for handling it:
399
+
400
+ * {Sass::Plugin::Configuration#template_location_array Sass::Plugin#template_location_array} --
401
+ Returns the template locations and CSS locations formatted as an array.
402
+
403
+ * {Sass::Plugin::Configuration#add_template_location Sass::Plugin#add_template_location} --
404
+ Converts the template location option to an array and adds a new location.
405
+
406
+ * {Sass::Plugin::Configuration#remove_template_location Sass::Plugin#remove_template_location} --
407
+ Converts the template location option to an array and removes an existing location.
408
+
409
+ ## 3.0.0
410
+ {#3-0-0}
411
+
412
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.0).
413
+
414
+ ### Deprecations -- Must Read!
415
+ {#3-0-0-deprecations}
416
+
417
+ * Using `=` for SassScript properties and variables is deprecated,
418
+ and will be removed in Sass 3.2.
419
+ Use `:` instead.
420
+ See also [this changelog entry](#3-0-0-sass-script-context)
421
+
422
+ * Because of the above, property values using `:`
423
+ will be parsed more thoroughly than they were before.
424
+ Although all valid CSS3 properties
425
+ as well as most hacks and proprietary syntax should be supported,
426
+ it's possible that some properties will break.
427
+ If this happens, please report it to [the Sass mailing list](http://groups.google.com/group/haml).
428
+
429
+ * In addition, setting the default value of variables
430
+ with `||=` is now deprecated
431
+ and will be removed in Sass 3.2.
432
+ Instead, add `!default` to the end of the value.
433
+ See also [this changelog entry](#3-0-0-default-flag)
434
+
435
+ * The `!` prefix for variables is deprecated,
436
+ and will be removed in Sass 3.2.
437
+ Use `$` as a prefix instead.
438
+ See also [this changelog entry](#3-0-0-dollar-prefix).
439
+
440
+ * The `css2sass` command-line tool has been deprecated,
441
+ and will be removed in Sass 3.2.
442
+ Use the new `sass-convert` tool instead.
443
+ See also [this changelog entry](#3-0-0-sass-convert).
444
+
445
+ * Selector parent references using `&` can now only be used
446
+ where element names are valid.
447
+ This is because Sass 3 fully parses selectors
448
+ to support the new [`@extend` directive](#3-0-0-extend),
449
+ and it's possible that the `&` could be replaced by an element name.
450
+
451
+ ### SCSS (Sassy CSS)
452
+
453
+ Sass 3 introduces a new syntax known as SCSS
454
+ which is fully compatible with the syntax of CSS3,
455
+ while still supporting the full power of Sass.
456
+ This means that every valid CSS3 stylesheet
457
+ is a valid SCSS file with the same meaning.
458
+ In addition, SCSS understands most CSS hacks
459
+ and vendor-specific syntax, such as [IE's old `filter` syntax](http://msdn.microsoft.com/en-us/library/ms533754%28VS.85%29.aspx).
460
+
461
+ SCSS files use the `.scss` extension.
462
+ They can import `.sass` files, and vice-versa.
463
+ Their syntax is fully described in the {file:SASS_REFERENCE.md Sass reference};
464
+ if you're already familiar with Sass, though,
465
+ you may prefer the {file:SCSS_FOR_SASS_USERS.md intro to SCSS for Sass users}.
466
+
467
+ Since SCSS is a much more approachable syntax for those new to Sass,
468
+ it will be used as the default syntax for the reference,
469
+ as well as for most other Sass documentation.
470
+ The indented syntax will continue to be fully supported, however.
471
+
472
+ Sass files can be converted to SCSS using the new `sass-convert` command-line tool.
473
+ For example:
474
+
475
+ # Convert a Sass file to SCSS
476
+ $ sass-convert style.sass style.scss
477
+
478
+ **Note that if you're converting a Sass file written for Sass 2**,
479
+ you should use the `--from sass2` flag.
480
+ For example:
481
+
482
+ # Convert a Sass file to SCSS
483
+ $ sass-convert --from sass2 style.sass style.scss
484
+
485
+ # Convert all Sass files to SCSS
486
+ $ sass-convert --recursive --in-place --from sass2 --to scss stylesheets/
487
+
488
+ ### Syntax Changes {#3-0-0-syntax-changes}
489
+
490
+ #### SassScript Context
491
+ {#3-0-0-sass-script-context}
492
+
493
+ The `=` character is no longer required for properties that use SassScript
494
+ (that is, variables and operations).
495
+ All properties now use SassScript automatically;
496
+ this means that `:` should be used instead.
497
+ Variables should also be set with `:`.
498
+ For example, what used to be
499
+
500
+ // Indented syntax
501
+ .page
502
+ color = 5px + 9px
503
+
504
+ should now be
505
+
506
+ // Indented syntax
507
+ .page
508
+ color: 5px + 9px
509
+
510
+ This means that SassScript is now an extension of the CSS3 property syntax.
511
+ All valid CSS3 properties are valid SassScript,
512
+ and will compile without modification
513
+ (some invalid properties work as well, such as Microsoft's proprietary `filter` syntax).
514
+ This entails a few changes to SassScript to make it fully CSS3-compatible,
515
+ which are detailed below.
516
+
517
+ This also means that Sass will now be fully parsing all property values,
518
+ rather than passing them through unchanged to the CSS.
519
+ Although care has been taken to support all valid CSS3,
520
+ as well as hacks and proprietary syntax,
521
+ it's possible that a property that worked in Sass 2 won't work in Sass 3.
522
+ If this happens, please report it to [the Sass mailing list](http://groups.google.com/group/haml).
523
+
524
+ Note that if `=` is used,
525
+ SassScript will be interpreted as backwards-compatibly as posssible.
526
+ In particular, the changes listed below don't apply in an `=` context.
527
+
528
+ The `sass-convert` command-line tool can be used
529
+ to upgrade Sass files to the new syntax using the `--in-place` flag.
530
+ For example:
531
+
532
+ # Upgrade style.sass:
533
+ $ sass-convert --in-place style.sass
534
+
535
+ # Upgrade all Sass files:
536
+ $ sass-convert --recursive --in-place --from sass2 --to sass stylesheets/
537
+
538
+ ##### Quoted Strings
539
+
540
+ Quoted strings (e.g. `"foo"`) in SassScript now render with quotes.
541
+ In addition, unquoted strings are no longer deprecated,
542
+ and render without quotes.
543
+ This means that almost all strings that had quotes in Sass 2
544
+ should not have quotes in Sass 3.
545
+
546
+ Although quoted strings render with quotes when used with `:`,
547
+ they do not render with quotes when used with `#{}`.
548
+ This allows quoted strings to be used for e.g. selectors
549
+ that are passed to mixins.
550
+
551
+ Strings can be forced to be quoted and unquoted using the new
552
+ \{Sass::Script::Functions#unquote unquote} and \{Sass::Script::Functions#quote quote}
553
+ functions.
554
+
555
+ ##### Division and `/`
556
+
557
+ Two numbers separated by a `/` character
558
+ are allowed as property syntax in CSS,
559
+ e.g. for the `font` property.
560
+ SassScript also uses `/` for division, however,
561
+ which means it must decide what to do
562
+ when it encounters numbers separated by `/`.
563
+
564
+ For CSS compatibility, SassScript does not perform division by default.
565
+ However, division will be done in almost all cases where division is intended.
566
+ In particular, SassScript will perform division
567
+ in the following three situations:
568
+
569
+ 1. If the value, or any part of it, is stored in a variable.
570
+ 2. If the value is surrounded by parentheses.
571
+ 3. If the value is used as part of another arithmetic expression.
572
+
573
+ For example:
574
+
575
+ p
576
+ font: 10px/8px
577
+ $width: 1000px
578
+ width: $width/2
579
+ height: (500px/2)
580
+ margin-left: 5px + 8px/2px
581
+
582
+ is compiled to:
583
+
584
+ p {
585
+ font: 10px/8px;
586
+ width: 500px;
587
+ height: 250px;
588
+ margin-left: 9px; }
589
+
590
+ ##### Variable Defaults
591
+
592
+ Since `=` is no longer used for variable assignment,
593
+ assigning defaults to variables with `||=` no longer makes sense.
594
+ Instead, the `!default` flag
595
+ should be added to the end of the variable value.
596
+ This syntax is meant to be similar to CSS's `!important` flag.
597
+ For example:
598
+
599
+ $var: 12px !default;
600
+
601
+ #### Variable Prefix Character
602
+ {#3-0-0-dollar-prefix}
603
+
604
+ The Sass variable character has been changed from `!`
605
+ to the more aesthetically-appealing `$`.
606
+ For example, what used to be
607
+
608
+ !width = 13px
609
+ .icon
610
+ width = !width
611
+
612
+ should now be
613
+
614
+ $width: 13px
615
+ .icon
616
+ width: $width
617
+
618
+ The `sass-convert` command-line tool can be used
619
+ to upgrade Sass files to the new syntax using the `--in-place` flag.
620
+ For example:
621
+
622
+ # Upgrade style.sass:
623
+ $ sass-convert --in-place style.sass
624
+
625
+ # Upgrade all Sass files:
626
+ $ sass-convert --recursive --in-place --from sass2 --to sass stylesheets/
627
+
628
+ `!` may still be used, but it's deprecated and will print a warning.
629
+ It will be removed in the next version of Sass, 3.2.
630
+
631
+ #### Variable and Mixin Names
632
+
633
+ SassScript variable and mixin names may now contain hyphens.
634
+ In fact, they may be any valid CSS3 identifier.
635
+ For example:
636
+
637
+ $prettiest-color: #542FA9
638
+ =pretty-text
639
+ color: $prettiest-color
640
+
641
+ In order to allow frameworks like [Compass](http://compass-style.org)
642
+ to use hyphens in variable names
643
+ while maintaining backwards-compatibility,
644
+ variables and mixins using hyphens may be referred to
645
+ with underscores, and vice versa.
646
+ For example:
647
+
648
+ $prettiest-color: #542FA9
649
+ .pretty
650
+ // Using an underscore instead of a hyphen works
651
+ color: $prettiest_color
652
+
653
+ #### Single-Quoted Strings
654
+
655
+ SassScript now supports single-quoted strings.
656
+ They behave identically to double-quoted strings,
657
+ except that single quotes need to be backslash-escaped
658
+ and double quotes do not.
659
+
660
+ #### Mixin Definition and Inclusion
661
+
662
+ Sass now supports the `@mixin` directive as a way of defining mixins (like `=`),
663
+ as well as the `@include` directive as a way of including them (like `+`).
664
+ The old syntax is *not* deprecated,
665
+ and the two are fully compatible.
666
+ For example:
667
+
668
+ @mixin pretty-text
669
+ color: $prettiest-color
670
+
671
+ a
672
+ @include pretty-text
673
+
674
+ is the same as:
675
+
676
+ =pretty-text
677
+ color: $prettiest-color
678
+
679
+ a
680
+ +pretty-text
681
+
682
+ #### Sass Properties
683
+
684
+ New-style properties (with the colon after the name) in indented syntax
685
+ now allow whitespace before the colon. For example:
686
+
687
+ foo
688
+ color : blue
689
+
690
+ #### Sass `@import`
691
+
692
+ The Sass `@import` statement now allows non-CSS files to be specified with quotes,
693
+ for similarity with the SCSS syntax. For example, `@import "foo.sass"`
694
+ will now import the `foo.sass` file, rather than compiling to `@import "foo.sass";`.
695
+
696
+ ### `@extend`
697
+ {#3-0-0-extend}
698
+
699
+ There are often cases when designing a page
700
+ when one class should have all the styles of another class,
701
+ as well as its own specific styles.
702
+ The most common way of handling this is to use both the more general class
703
+ and the more specific class in the HTML.
704
+ For example, suppose we have a design for a normal error
705
+ and also for a serious error. We might write our markup like so:
706
+
707
+ <div class="error seriousError">
708
+ Oh no! You've been hacked!
709
+ </div>
710
+
711
+ And our styles like so:
712
+
713
+ .error {
714
+ border: 1px #f00;
715
+ background-color: #fdd;
716
+ }
717
+ .seriousError {
718
+ border-width: 3px;
719
+ }
720
+
721
+ Unfortunately, this means that we have to always remember
722
+ to use `.error` with `.seriousError`.
723
+ This is a maintenance burden, leads to tricky bugs,
724
+ and can bring non-semantic style concerns into the markup.
725
+
726
+ The `@extend` directive avoids these problems
727
+ by telling Sass that one selector should inherit the styles of another selector.
728
+ For example:
729
+
730
+ .error {
731
+ border: 1px #f00;
732
+ background-color: #fdd;
733
+ }
734
+ .seriousError {
735
+ @extend .error;
736
+ border-width: 3px;
737
+ }
738
+
739
+ This means that all styles defined for `.error`
740
+ are also applied to `.seriousError`,
741
+ in addition to the styles specific to `.seriousError`.
742
+ In effect, everything with class `.seriousError` also has class `.error`.
743
+
744
+ Other rules that use `.error` will work for `.seriousError` as well.
745
+ For example, if we have special styles for errors caused by hackers:
746
+
747
+ .error.intrusion {
748
+ background-image: url("/image/hacked.png");
749
+ }
750
+
751
+ Then `<div class="seriousError intrusion">`
752
+ will have the `hacked.png` background image as well.
753
+
754
+ #### How it Works
755
+
756
+ `@extend` works by inserting the extending selector (e.g. `.seriousError`)
757
+ anywhere in the stylesheet that the extended selector (.e.g `.error`) appears.
758
+ Thus the example above:
759
+
760
+ .error {
761
+ border: 1px #f00;
762
+ background-color: #fdd;
763
+ }
764
+ .error.intrusion {
765
+ background-image: url("/image/hacked.png");
766
+ }
767
+ .seriousError {
768
+ @extend .error;
769
+ border-width: 3px;
770
+ }
771
+
772
+ is compiled to:
773
+
774
+ .error, .seriousError {
775
+ border: 1px #f00;
776
+ background-color: #fdd; }
777
+
778
+ .error.intrusion, .seriousError.intrusion {
779
+ background-image: url("/image/hacked.png"); }
780
+
781
+ .seriousError {
782
+ border-width: 3px; }
783
+
784
+ When merging selectors, `@extend` is smart enough
785
+ to avoid unnecessary duplication,
786
+ so something like `.seriousError.seriousError` gets translated to `.seriousError`.
787
+ In addition, it won't produce selectors that can't match anything, like `#main#footer`.
788
+
789
+ See also {file:SASS_REFERENCE.md#extend the `@extend` reference documentation}.
790
+
791
+ ### Colors
792
+
793
+ SassScript color values are much more powerful than they were before.
794
+ Support was added for alpha channels,
795
+ and most of Chris Eppstein's [compass-colors](http://chriseppstein.github.com/compass-colors) plugin
796
+ was merged in, providing color-theoretic functions for modifying colors.
797
+
798
+ One of the most interesting of these functions is {Sass::Script::Functions#mix mix},
799
+ which mixes two colors together.
800
+ This provides a much better way of combining colors and creating themes
801
+ than standard color arithmetic.
802
+
803
+ #### Alpha Channels
804
+
805
+ Sass now supports colors with alpha channels,
806
+ constructed via the {Sass::Script::Functions#rgba rgba}
807
+ and {Sass::Script::Functions#hsla hsla} functions.
808
+ Alpha channels are unaffected by color arithmetic.
809
+ However, the {Sass::Script::Functions#opacify opacify}
810
+ and {Sass::Script::Functions#transparentize transparentize} functions
811
+ allow colors to be made more and less opaque, respectively.
812
+
813
+ Sass now also supports functions that return the values of the
814
+ {Sass::Script::Functions#red red},
815
+ {Sass::Script::Functions#blue blue},
816
+ {Sass::Script::Functions#green green},
817
+ and {Sass::Script::Functions#alpha alpha}
818
+ components of colors.
819
+
820
+ #### HSL Colors
821
+
822
+ Sass has many new functions for using the HSL values of colors.
823
+ For an overview of HSL colors, check out [the CSS3 Spec](http://www.w3.org/TR/css3-color/#hsl-color).
824
+ All these functions work just as well on RGB colors
825
+ as on colors constructed with the {Sass::Script::Functions#hsl hsl} function.
826
+
827
+ * The {Sass::Script::Functions#lighten lighten}
828
+ and {Sass::Script::Functions#darken darken}
829
+ functions adjust the lightness of a color.
830
+
831
+ * The {Sass::Script::Functions#saturate saturate}
832
+ and {Sass::Script::Functions#desaturate desaturate}
833
+ functions adjust the saturation of a color.
834
+
835
+ * The {Sass::Script::Functions#adjust_hue adjust-hue}
836
+ function adjusts the hue of a color.
837
+
838
+ * The {Sass::Script::Functions#hue hue},
839
+ {Sass::Script::Functions#saturation saturation},
840
+ and {Sass::Script::Functions#lightness lightness}
841
+ functions return the corresponding HSL values of the color.
842
+
843
+ * The {Sass::Script::Functions#grayscale grayscale}
844
+ function converts a color to grayscale.
845
+
846
+ * The {Sass::Script::Functions#complement complement}
847
+ function returns the complement of a color.
848
+
849
+ ### Other New Functions
850
+
851
+ Several other new functions were added to make it easier to have
852
+ more flexible arguments to mixins and to enable deprecation
853
+ of obsolete APIs.
854
+
855
+ * {Sass::Script::Functions#type_of `type-of`} -- Returns the type of a value.
856
+ * {Sass::Script::Functions#unit `unit`} --
857
+ Returns the units associated with a number.
858
+ * {Sass::Script::Functions#unitless `unitless`} --
859
+ Returns whether a number has units or not.
860
+ * {Sass::Script::Functions#comparable `comparable`} --
861
+ Returns whether two numbers can be added or compared.
862
+
863
+ ### Watching for Updates
864
+ {#3-0-0-watch}
865
+
866
+ The `sass` command-line utility has a new flag: `--watch`.
867
+ `sass --watch` monitors files or directories for updated Sass files
868
+ and compiles those files to CSS automatically.
869
+ This will allow people not using Ruby or [Compass](http://compass-style.org)
870
+ to use Sass without having to manually recompile all the time.
871
+
872
+ Here's the syntax for watching a directory full of Sass files:
873
+
874
+ sass --watch app/stylesheets:public/stylesheets
875
+
876
+ This will watch every Sass file in `app/stylesheets`.
877
+ Whenever one of them changes,
878
+ the corresponding CSS file in `public/stylesheets` will be regenerated.
879
+ Any files that import that file will be regenerated, too.
880
+
881
+ The syntax for watching individual files is the same:
882
+
883
+ sass --watch style.sass:out.css
884
+
885
+ You can also omit the output filename if you just want it to compile to name.css.
886
+ For example:
887
+
888
+ sass --watch style.sass
889
+
890
+ This will update `style.css` whenever `style.sass` changes.
891
+
892
+ You can list more than one file and/or directory,
893
+ and all of them will be watched:
894
+
895
+ sass --watch foo/style:public/foo bar/style:public/bar
896
+ sass --watch screen.sass print.sass awful-hacks.sass:ie.css
897
+ sass --watch app/stylesheets:public/stylesheets public/stylesheets/test.sass
898
+
899
+ File and directory watching is accessible from Ruby,
900
+ using the {Sass::Plugin::Compiler#watch Sass::Plugin#watch} function.
901
+
902
+ #### Bulk Updating
903
+
904
+ Another new flag for the `sass` command-line utility is `--update`.
905
+ It checks a group of Sass files to see if their CSS needs to be updated,
906
+ and updates if so.
907
+
908
+ The syntax for `--update` is just like watch:
909
+
910
+ sass --update app/stylesheets:public/stylesheets
911
+ sass --update style.sass:out.css
912
+ sass --watch screen.sass print.sass awful-hacks.sass:ie.css
913
+
914
+ In fact, `--update` work exactly the same as `--watch`,
915
+ except that it doesn't continue watching the files
916
+ after the first check.
917
+
918
+ ### `sass-convert` (née `css2sass`) {#3-0-0-sass-convert}
919
+
920
+ The `sass-convert` tool, which used to be known as `css2sass`,
921
+ has been greatly improved in various ways.
922
+ It now uses a full-fledged CSS3 parser,
923
+ so it should be able to handle any valid CSS3,
924
+ as well as most hacks and proprietary syntax.
925
+
926
+ `sass-convert` can now convert between Sass and SCSS.
927
+ This is normally inferred from the filename,
928
+ but it can also be specified using the `--from` and `--to` flags.
929
+ For example:
930
+
931
+ $ generate-sass | sass-convert --from sass --to scss | consume-scss
932
+
933
+ It's also now possible to convert a file in-place --
934
+ that is, overwrite the old file with the new file.
935
+ This is useful for converting files in the [Sass 2 syntax](#3-0-0-deprecations)
936
+ to the new Sass 3 syntax,
937
+ e.g. by doing `sass-convert --in-place --from sass2 style.sass`.
938
+
939
+ #### `--recursive`
940
+
941
+ The `--recursive` option allows `sass-convert` to convert an entire directory of files.
942
+ `--recursive` requires both the `--from` and `--to` flags to be specified.
943
+ For example:
944
+
945
+ # Convert all .sass files in stylesheets/ to SCSS.
946
+ # "sass2" means that these files are assumed to use the Sass 2 syntax.
947
+ $ sass-convert --recursive --from sass2 --to scss stylesheets/
948
+
949
+ #### `--dasherize`
950
+
951
+ The `--dasherize` options converts all underscores to hyphens,
952
+ which are now allowed as part of identifiers in Sass.
953
+ Note that since underscores may still be used in place of hyphens
954
+ when referring to mixins and variables,
955
+ this won't cause any backwards-incompatibilities.
956
+
957
+ #### Convert Less to SCSS
958
+
959
+ `sass-convert` can also convert [Less](http://lesscss.org) files
960
+ to SCSS (or the indented syntax, although I anticipate less interest in that).
961
+ For example:
962
+
963
+ # Convert all .less files in the current directory into .scss files
964
+ sass-convert --from less --to scss --recursive .
965
+
966
+ This is done using the Less parser, so it requires that the `less` RubyGem be installed.
967
+
968
+ ##### Incompatibilities
969
+
970
+ Because of the reasonably substantial differences between Sass and Less,
971
+ there are some things that can't be directly translated,
972
+ and one feature that can't be translated at all.
973
+ In the tests I've run on open-source Less stylesheets,
974
+ none of these have presented issues, but it's good to be aware of them.
975
+
976
+ First, Less doesn't distinguish fully between mixins and selector inheritance.
977
+ In Less, all classes and some other selectors may be used as mixins,
978
+ alongside more Sass-like mixins.
979
+ If a class is being used as a mixin,
980
+ it may also be used directly in the HTML,
981
+ so it's not safe to translate it into a Sass mixin.
982
+ What `sass-convert` does instead is leave the class in the stylesheet as a class,
983
+ and use {file:SASS_REFERENCE.md#extend `@extend`}
984
+ rather than {file:SASS_REFERENCE.md#including_a_mixin `@include`}
985
+ to take on the styles of that class.
986
+ Although `@extend` and mixins work quite differently,
987
+ using `@extend` here doesn't actually seem to make a difference in practice.
988
+
989
+ Another issue with Less mixins is that Less allows nested selectors
990
+ (such as `.body .button` or `.colors > .teal`) to be used
991
+ as a means of "namespacing" mixins.
992
+ Sass's `@extend` doesn't work that way,
993
+ so it does away with the namespacing and just extends the base class
994
+ (so `.colors > .teal` becomes simply `@extend .teal`).
995
+ In practice, this feature doesn't seem to be widely-used,
996
+ but `sass-convert` will print a warning and leave a comment
997
+ when it encounters it just in case.
998
+
999
+ Finally, Less has the ability to directly access variables and property values
1000
+ defined in other selectors, which Sass does not support.
1001
+ Whenever such an accessor is used,
1002
+ `sass-convert` will print a warning
1003
+ and comment it out in the SCSS output.
1004
+ Like namespaced mixins, though,
1005
+ this does not seem to be a widely-used feature.
1006
+
1007
+ ### `@warn` Directive
1008
+
1009
+ A new directive `@warn` has been added that allows Sass libraries to emit warnings.
1010
+ This can be used to issue deprecation warnings, discourage sloppy use of mixins, etc.
1011
+ `@warn` takes a single argument: a SassScript expression that will be
1012
+ displayed on the console along with a stylesheet trace for locating the warning.
1013
+ For example:
1014
+
1015
+ @mixin blue-text {
1016
+ @warn "The blue-text mixin is deprecated. Use new-blue-text instead.";
1017
+ color: #00f;
1018
+ }
1019
+
1020
+ Warnings may be silenced with the new `--quiet` command line option,
1021
+ or the corresponding {file:SASS_REFERENCE.md#quiet-option `:quiey` Sass option}.
1022
+ This option will also affect warnings printed by Sass itself.
1023
+ Warnings are off by default in the Rails, Rack, and Merb production environments.
1024
+
1025
+ ### Sass::Plugin API
1026
+
1027
+ {Sass::Plugin} now has a large collection of callbacks that allow users
1028
+ to run code when various actions are performed.
1029
+ For example:
1030
+
1031
+ Sass::Plugin.on_updating_stylesheet do |template, css|
1032
+ puts "#{template} has been compiled to #{css}!"
1033
+ end
1034
+
1035
+ For a full list of callbacks and usage notes, see the {Sass::Plugin} documentation.
1036
+
1037
+ {Sass::Plugin} also has a new method,
1038
+ {Sass::Plugin#force_update_stylesheets force_update_stylesheets}.
1039
+ This works just like {Sass::Plugin#update_stylesheets},
1040
+ except that it doesn't check modification times and doesn't use the cache;
1041
+ all stylesheets are always compiled anew.
1042
+
1043
+ ### Output Formatting
1044
+
1045
+ Properties with a value and *also* nested properties
1046
+ are now rendered with the nested properties indented.
1047
+ For example:
1048
+
1049
+ margin: auto
1050
+ top: 10px
1051
+ bottom: 20px
1052
+
1053
+ is now compiled to:
1054
+
1055
+ margin: auto;
1056
+ margin-top: 10px;
1057
+ margin-bottom: 20px;
1058
+
1059
+ #### `:compressed` Style
1060
+
1061
+ When the `:compressed` style is used,
1062
+ colors will be output as the minimal possible representation.
1063
+ This means whichever is smallest of the HTML4 color name
1064
+ and the hex representation (shortened to the three-letter version if possible).
1065
+
1066
+ ### Stylesheet Updating Speed
1067
+
1068
+ Several caching layers were added to Sass's stylesheet updater.
1069
+ This means that it should run significantly faster.
1070
+ This benefit will be seen by people using Sass in development mode
1071
+ with Rails, Rack, and Merb,
1072
+ as well as people using `sass --watch` from the command line,
1073
+ and to a lesser (but still significant) extent `sass --update`.
1074
+ Thanks to [thedarkone](http://github.com/thedarkone).
1075
+
1076
+ ### Error Backtraces
1077
+
1078
+ Numerous bugs were fixed with the backtraces given for Sass errors,
1079
+ especially when importing files and using mixins.
1080
+ All imports and mixins will now show up in the Ruby backtrace,
1081
+ with the proper filename and line number.
1082
+
1083
+ In addition, when the `sass` executable encounters an error,
1084
+ it now prints the filename where the error occurs,
1085
+ as well as a backtrace of Sass imports and mixins.
1086
+
1087
+ ### Ruby 1.9 Support
1088
+
1089
+ * Sass and `css2sass` now produce more descriptive errors
1090
+ when given a template with invalid byte sequences for that template's encoding,
1091
+ including the line number and the offending character.
1092
+
1093
+ * Sass and `css2sass` now accept Unicode documents with a
1094
+ [byte-order-mark](http://en.wikipedia.org/wiki/Byte_order_mark).
1095
+
1096
+ ### Firebug Support
1097
+
1098
+ A new {file:SASS_REFERENCE.md#debug_info-option `:debug_info` option}
1099
+ has been added that emits line-number and filename information
1100
+ to the CSS file in a browser-readable format.
1101
+ This can be used with the new [FireSass Firebug extension](https://addons.mozilla.org/en-US/firefox/addon/103988)
1102
+ to report the Sass filename and line number for generated CSS files.
1103
+
1104
+ This is also available via the `--debug-info` command-line flag.
1105
+
1106
+ ### Minor Improvements
1107
+
1108
+ * If a CSS or Sass function is used that has the name of a color,
1109
+ it will now be parsed as a function rather than as a color.
1110
+ For example, `fuchsia(12)` now renders as `fuchsia(12)`
1111
+ rather than `fuchsia 12`,
1112
+ and `tealbang(12)` now renders as `tealbang(12)`
1113
+ rather than `teal bang(12)`.
1114
+
1115
+ * The Sass Rails and Merb plugins now use Rack middleware by default.
1116
+
1117
+ * Haml is now compatible with the [Rip](http://hellorip.com/) package management system.
1118
+ Thanks to [Josh Peek](http://joshpeek.com/).
1119
+
1120
+ * Indented-syntax `/*` comments may now include `*` on lines beyond the first.
1121
+
1122
+ * A {file:SASS_REFERENCE.md#read_cache-option `:read_cache`} option has been added
1123
+ to allow the Sass cache to be read from but not written to.
1124
+
1125
+ * Stylesheets are no longer checked during each request
1126
+ when running tests in Rails.
1127
+ This should speed up some tests significantly.
1128
+
1129
+ ## 2.2.24
1130
+
1131
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24).
1132
+
1133
+ * Parent references -- the `&` character --
1134
+ may only be placed at the beginning of simple selector sequences in Sass 3.
1135
+ Placing them elsewhere is deprecated in 2.2.24 and will print a warning.
1136
+ For example, `foo &.bar` is allowed, but `foo .bar&` is not.
1137
+
1138
+ ## 2.2.23
1139
+
1140
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23).
1141
+
1142
+ * Don't crash when `rake gems` is run in Rails with Sass installed.
1143
+ Thanks to [Florian Frank](http://github.com/flori).
1144
+
1145
+ * When raising a file-not-found error,
1146
+ add a list of load paths that were checked.
1147
+
1148
+ * If an import isn't found for a cached Sass file and the
1149
+ {file:SASS_REFERENCE.md#full_exception `:full_exception option`} is enabled,
1150
+ print the full exception rather than raising it.
1151
+
1152
+ * Fix a bug with a weird interaction with Haml, DataMapper, and Rails 3
1153
+ that caused some tag helpers to go into infinite recursion.
1154
+
1155
+ ## 2.2.22
1156
+
1157
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22).
1158
+
1159
+ * Add a railtie so Haml and Sass will be automatically loaded in Rails 3.
1160
+ Thanks to [Daniel Neighman](http://pancakestacks.wordpress.com/).
1161
+
1162
+ * Make loading the gemspec not crash on read-only filesystems like Heroku's.
1163
+
1164
+ ## 2.2.21
1165
+
1166
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.21).
1167
+
1168
+ * Fix a few bugs in the git-revision-reporting in {Haml::Version#version}.
1169
+ In particular, it will still work if `git gc` has been called recently,
1170
+ or if various files are missing.
1171
+
1172
+ * Always use `__FILE__` when reading files within the Haml repo in the `Rakefile`.
1173
+ According to [this bug report](http://github.com/carlhuda/bundler/issues/issue/44),
1174
+ this should make Sass work better with Bundler.
1175
+
1176
+ ## 2.2.20
1177
+
1178
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.20).
1179
+
1180
+ * If the cache file for a given Sass file is corrupt
1181
+ because it doesn't have enough content,
1182
+ produce a warning and read the Sass file
1183
+ rather than letting the exception bubble up.
1184
+ This is consistent with other sorts of sassc corruption handling.
1185
+
1186
+ * Calls to `defined?` shouldn't interfere with Rails' autoloading
1187
+ in very old versions (1.2.x).
1188
+
1189
+ ## 2.2.19
1190
+
1191
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18).
1192
+
1193
+ There were no changes made to Sass between versions 2.2.18 and 2.2.19.
1194
+
1195
+ ## 2.2.18
1196
+
1197
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18).
1198
+
1199
+ * Use `Rails.env` rather than `RAILS_ENV` when running under Rails 3.0.
1200
+ Thanks to [Duncan Grazier](http://duncangrazier.com/).
1201
+
1202
+ * Support `:line_numbers` as an alias for {file:SASS_REFERENCE.md#line_numbers-option `:line_comments`},
1203
+ since that's what the docs have said forever.
1204
+ Similarly, support `--line-numbers` as a command-line option.
1205
+
1206
+ * Add a `--unix-newlines` flag to all executables
1207
+ for outputting Unix-style newlines on Windows.
1208
+
1209
+ * Add a {file:SASS_REFERENCE.md#unix_newlines-option `:unix_newlines` option}
1210
+ for {Sass::Plugin} for outputting Unix-style newlines on Windows.
1211
+
1212
+ * Fix the `--cache-location` flag, which was previously throwing errors.
1213
+ Thanks to [tav](http://tav.espians.com/).
1214
+
1215
+ * Allow comments at the beginning of the document to have arbitrary indentation,
1216
+ just like comments elsewhere.
1217
+ Similarly, comment parsing is a little nicer than before.
1218
+
1219
+ ## 2.2.17
1220
+
1221
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16).
1222
+
1223
+ * When the {file:SASS_REFERENCE.md#full_exception-option `:full_exception` option}
1224
+ is false, raise the error in Ruby code rather than swallowing it
1225
+ and printing something uninformative.
1226
+
1227
+ * Fixed error-reporting when something goes wrong when loading Sass
1228
+ using the `sass` executable.
1229
+ This used to raise a NameError because `Sass::SyntaxError` wasn't defined.
1230
+ Now it'll raise the correct exception instead.
1231
+
1232
+ * Report the filename in warnings about selectors without properties.
1233
+
1234
+ * `nil` values for Sass options are now ignored,
1235
+ rather than raising errors.
1236
+
1237
+ * Fix a bug that appears when Plugin template locations
1238
+ have multiple trailing slashes.
1239
+ Thanks to [Jared Grippe](http://jaredgrippe.com/).
1240
+
1241
+ ### Must Read!
1242
+
1243
+ * When `@import` is given a filename without an extension,
1244
+ the behavior of rendering a CSS `@import` if no Sass file is found
1245
+ is deprecated.
1246
+ In future versions, `@import foo` will either import the template
1247
+ or raise an error.
1248
+
1249
+ ## 2.2.16
1250
+
1251
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16).
1252
+
1253
+ * Fixed a bug where modules containing user-defined Sass functions
1254
+ weren't made available when simply included in {Sass::Script::Functions}
1255
+ ({Sass::Script::Functions Functions} needed to be re-included in
1256
+ {Sass::Script::Functions::EvaluationContext Functions::EvaluationContext}).
1257
+ Now the module simply needs to be included in {Sass::Script::Functions}.
1258
+
1259
+ ## 2.2.15
1260
+
1261
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.15).
1262
+
1263
+ * Added {Sass::Script::Color#with} for a way of setting color channels
1264
+ that's easier than manually constructing a new color
1265
+ and is forwards-compatible with alpha-channel colors
1266
+ (to be introduced in Sass 2.4).
1267
+
1268
+ * Added a missing require in Sass that caused crashes
1269
+ when it was being run standalone.
1270
+
1271
+ ## 2.2.14
1272
+
1273
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.14).
1274
+
1275
+ * All Sass functions now raise explicit errors if their inputs
1276
+ are of the incorrect type.
1277
+
1278
+ * Allow the SassScript `rgb()` function to take percentages
1279
+ in addition to numerical values.
1280
+
1281
+ * Fixed a bug where SassScript strings with `#` followed by `#{}` interpolation
1282
+ didn't evaluate the interpolation.
1283
+
1284
+ ### SassScript Ruby API
1285
+
1286
+ These changes only affect people defining their own Sass functions
1287
+ using {Sass::Script::Functions}.
1288
+
1289
+ * {Sass::Script::Color#value} attribute is deprecated.
1290
+ Use {Sass::Script::Color#rgb} instead.
1291
+ The returned array is now frozen as well.
1292
+
1293
+ * Add an `assert_type` function that's available to {Sass::Script::Functions}.
1294
+ This is useful for typechecking the inputs to functions.
1295
+
1296
+ ### Rack Support
1297
+
1298
+ Sass 2.2.14 includes Rack middleware for running Sass,
1299
+ meaning that all Rack-enabled frameworks can now use Sass.
1300
+ To activate this, just add
1301
+
1302
+ require 'sass/plugin/rack'
1303
+ use Sass::Plugin::Rack
1304
+
1305
+ to your `config.ru`.
1306
+ See the {Sass::Plugin::Rack} documentation for more details.
1307
+
1308
+ ## 2.2.13
1309
+
1310
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.13).
1311
+
1312
+ There were no changes made to Sass between versions 2.2.12 and 2.2.13.
1313
+
1314
+ ## 2.2.12
1315
+
1316
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.12).
1317
+
1318
+ * Fix a stupid bug introduced in 2.2.11 that broke the Sass Rails plugin.
1319
+
1320
+ ## 2.2.11
1321
+
1322
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.11).
1323
+
1324
+ * Added a note to errors on properties that could be pseudo-classes (e.g. `:focus`)
1325
+ indicating that they should be backslash-escaped.
1326
+
1327
+ * Automatically interpret properties that could be pseudo-classes as such
1328
+ if {file:SASS_REFERENCE.md.html#property_syntax-option `:property_syntax`}
1329
+ is set to `:new`.
1330
+
1331
+ * Fixed `css2sass`'s generation of pseudo-classes so that they're backslash-escaped.
1332
+
1333
+ * Don't crash if the Haml plugin skeleton is installed and `rake gems:install` is run.
1334
+
1335
+ * Don't use `RAILS_ROOT` directly.
1336
+ This no longer exists in Rails 3.0.
1337
+ Instead abstract this out as `Haml::Util.rails_root`.
1338
+ This changes makes Haml fully compatible with edge Rails as of this writing.
1339
+
1340
+ * Make use of a Rails callback rather than a monkeypatch to check for stylesheet updates
1341
+ in Rails 3.0+.
1342
+
1343
+ ## 2.2.10
1344
+
1345
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.10).
1346
+
1347
+ * Add support for attribute selectors with spaces around the `=`.
1348
+ For example:
1349
+
1350
+ a[href = http://google.com]
1351
+ color: blue
1352
+
1353
+ ## 2.2.9
1354
+
1355
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.9).
1356
+
1357
+ There were no changes made to Sass between versions 2.2.8 and 2.2.9.
1358
+
1359
+ ## 2.2.8
1360
+
1361
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.8).
1362
+
1363
+ There were no changes made to Sass between versions 2.2.7 and 2.2.8.
1364
+
1365
+ ## 2.2.7
1366
+
1367
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.7).
1368
+
1369
+ There were no changes made to Sass between versions 2.2.6 and 2.2.7.
1370
+
1371
+ ## 2.2.6
1372
+
1373
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.6).
1374
+
1375
+ * Don't crash when the `__FILE__` constant of a Ruby file is a relative path,
1376
+ as apparently happens sometimes in TextMate
1377
+ (thanks to [Karl Varga](http://github.com/kjvarga)).
1378
+
1379
+ * Add "Sass" to the `--version` string for the executables.
1380
+
1381
+ ## 2.2.5
1382
+
1383
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.5).
1384
+
1385
+ There were no changes made to Sass between versions 2.2.4 and 2.2.5.
1386
+
1387
+ ## 2.2.4
1388
+
1389
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.4).
1390
+
1391
+ * Don't add `require 'rubygems'` to the top of init.rb when installed
1392
+ via `sass --rails`. This isn't necessary, and actually gets
1393
+ clobbered as soon as haml/template is loaded.
1394
+
1395
+ * Document the previously-undocumented {file:SASS_REFERENCE.md#line-option `:line` option},
1396
+ which allows the number of the first line of a Sass file to be set for error reporting.
1397
+
1398
+ ## 2.2.3
1399
+
1400
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.3).
1401
+
1402
+ Sass 2.2.3 prints line numbers for warnings about selectors
1403
+ with no properties.
1404
+
1405
+ ## 2.2.2
1406
+
1407
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.2).
1408
+
1409
+ Sass 2.2.2 is a minor bug-fix release.
1410
+ Notable changes include better parsing of mixin definitions and inclusions
1411
+ and better support for Ruby 1.9.
1412
+
1413
+ ## 2.2.1
1414
+
1415
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.1).
1416
+
1417
+ Sass 2.2.1 is a minor bug-fix release.
1418
+
1419
+ ### Must Read!
1420
+
1421
+ * It used to be acceptable to use `-` immediately following variable names,
1422
+ without any whitespace in between (for example, `!foo-!bar`).
1423
+ This is now deprecated, so that in the future variables with hyphens
1424
+ can be supported. Surround `-` with spaces.
1425
+
1426
+ ## 2.2.0
1427
+
1428
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.0).
1429
+
1430
+ The 2.2 release marks a significant step in the evolution of the Sass
1431
+ language. The focus has been to increase the power of Sass to keep
1432
+ your stylesheets maintainable by allowing new forms of abstraction to
1433
+ be created within your stylesheets and the stylesheets provided by
1434
+ others that you can download and import into your own. The fundamental
1435
+ units of abstraction in Sass are variables and mixins. Please read
1436
+ below for a list of changes:
1437
+
1438
+ ### Must Read!
1439
+
1440
+ * Sass Comments (//) used to only comment out a single line. This was deprecated
1441
+ in 2.0.10 and starting in 2.2, Sass comments will comment out any lines indented
1442
+ under them. Upgrade to 2.0.10 in order to see deprecation warnings where this change
1443
+ affects you.
1444
+
1445
+ * Implicit Strings within SassScript are now deprecated and will be removed in 2.4.
1446
+ For example: `border= !width solid #00F` should now be written as `border: #{!width} solid #00F`
1447
+ or as `border= !width "solid" #00F`. After upgrading to 2.2, you will see deprecation warnings
1448
+ if you have sass files that use implicit strings.
1449
+
1450
+
1451
+ ### Sass Syntax Changes
1452
+
1453
+ #### Flexible Indentation
1454
+
1455
+ The indentation of Sass documents is now flexible. The first indent
1456
+ that is detected will determine the indentation style for that
1457
+ document. Tabs and spaces may never be mixed, but within a document,
1458
+ you may choose to use tabs or a flexible number of spaces.
1459
+
1460
+ #### Multiline Sass Comments
1461
+
1462
+ Sass Comments (//) will now comment out whatever is indented beneath
1463
+ them. Previously they were single line when used at the top level of a
1464
+ document. Upgrading to the latest stable version will give you
1465
+ deprecation warnings if you have silent comments with indentation
1466
+ underneath them.
1467
+
1468
+ #### Mixin Arguments
1469
+
1470
+ Sass Mixins now accept any number of arguments. To define a mixin with
1471
+ arguments, specify the arguments as a comma-delimited list of
1472
+ variables like so:
1473
+
1474
+ =my-mixin(!arg1, !arg2, !arg3)
1475
+
1476
+ As before, the definition of the mixin is indented below the mixin
1477
+ declaration. The variables declared in the argument list may be used
1478
+ and will be bound to the values passed to the mixin when it is
1479
+ invoked. Trailing arguments may have default values as part of the
1480
+ declaration:
1481
+
1482
+ =my-mixin(!arg1, !arg2 = 1px, !arg3 = blue)
1483
+
1484
+ In the example above, the mixin may be invoked by passing 1, 2 or 3
1485
+ arguments to it. A similar syntax is used to invoke a mixin that
1486
+ accepts arguments:
1487
+
1488
+ div.foo
1489
+ +my-mixin(1em, 3px)
1490
+
1491
+ When a mixin has no required arguments, the parenthesis are optional.
1492
+
1493
+ The default values for mixin arguments are evaluated in the global
1494
+ context at the time when the mixin is invoked, they may also reference
1495
+ the previous arguments in the declaration. For example:
1496
+
1497
+ !default_width = 30px
1498
+ =my-fancy-mixin(!width = !default_width, !height = !width)
1499
+ width= !width
1500
+ height= !height
1501
+
1502
+ .default-box
1503
+ +my-fancy-mixin
1504
+
1505
+ .square-box
1506
+ +my-fancy-mixin(50px)
1507
+
1508
+ .rectangle-box
1509
+ +my-fancy-mixin(25px, 75px)
1510
+
1511
+ !default_width = 10px
1512
+ .small-default-box
1513
+ +my-fancy-mixin
1514
+
1515
+
1516
+ compiles to:
1517
+
1518
+ .default-box {
1519
+ width: 30px;
1520
+ height: 30px; }
1521
+
1522
+ .square-box {
1523
+ width: 50px;
1524
+ height: 50px; }
1525
+
1526
+ .rectangle-box {
1527
+ width: 25px;
1528
+ height: 75px; }
1529
+
1530
+ .small-default-box {
1531
+ width: 10px;
1532
+ height: 10px; }
1533
+
1534
+
1535
+ ### Sass, Interactive
1536
+
1537
+ The sass command line option -i now allows you to quickly and
1538
+ interactively experiment with SassScript expressions. The value of the
1539
+ expression you enter will be printed out after each line. Example:
1540
+
1541
+ $ sass -i
1542
+ >> 5px
1543
+ 5px
1544
+ >> 5px + 10px
1545
+ 15px
1546
+ >> !five_pixels = 5px
1547
+ 5px
1548
+ >> !five_pixels + 10px
1549
+ 15px
1550
+
1551
+ ### SassScript
1552
+
1553
+ The features of SassScript have been greatly enhanced with new control
1554
+ directives, new fundamental data types, and variable scoping.
1555
+
1556
+ #### New Data Types
1557
+
1558
+ SassScript now has four fundamental data types:
1559
+
1560
+ 1. Number
1561
+ 2. String
1562
+ 3. Boolean (New in 2.2)
1563
+ 4. Colors
1564
+
1565
+ #### More Flexible Numbers
1566
+
1567
+ Like JavaScript, SassScript numbers can now change between floating
1568
+ point and integers. No explicit casting or decimal syntax is
1569
+ required. When a number is emitted into a CSS file it will be rounded
1570
+ to the nearest thousandth, however the internal representation
1571
+ maintains much higher precision.
1572
+
1573
+ #### Improved Handling of Units
1574
+
1575
+ While Sass has long supported numbers with units, it now has a much
1576
+ deeper understanding of them. The following are examples of legal
1577
+ numbers in SassScript:
1578
+
1579
+ 0, 1000, 6%, -2px, 5pc, 20em, or 2foo.
1580
+
1581
+ Numbers of the same unit may always be added and subtracted. Numbers
1582
+ that have units that Sass understands and finds comparable, can be
1583
+ combined, taking the unit of the first number. Numbers that have
1584
+ non-comparable units may not be added nor subtracted -- any attempt to
1585
+ do so will cause an error. However, a unitless number takes on the
1586
+ unit of the other number during a mathematical operation. For example:
1587
+
1588
+ >> 3mm + 4cm
1589
+ 43mm
1590
+ >> 4cm + 3mm
1591
+ 4.3cm
1592
+ >> 3cm + 2in
1593
+ 8.08cm
1594
+ >> 5foo + 6foo
1595
+ 11foo
1596
+ >> 4% + 5px
1597
+ SyntaxError: Incompatible units: 'px' and '%'.
1598
+ >> 5 + 10px
1599
+ 15px
1600
+
1601
+ Sass allows compound units to be stored in any intermediate form, but
1602
+ will raise an error if you try to emit a compound unit into your css
1603
+ file.
1604
+
1605
+ >> !em_ratio = 1em / 16px
1606
+ 0.063em/px
1607
+ >> !em_ratio * 32px
1608
+ 2em
1609
+ >> !em_ratio * 40px
1610
+ 2.5em
1611
+
1612
+ #### Colors
1613
+
1614
+ A color value can be declared using a color name, hexadecimal,
1615
+ shorthand hexadecimal, the rgb function, or the hsl function. When
1616
+ outputting a color into css, the color name is used, if any, otherwise
1617
+ it is emitted as hexadecimal value. Examples:
1618
+
1619
+ > #fff
1620
+ white
1621
+ >> white
1622
+ white
1623
+ >> #FFFFFF
1624
+ white
1625
+ >> hsl(180, 100, 100)
1626
+ white
1627
+ >> rgb(255, 255, 255)
1628
+ white
1629
+ >> #AAA
1630
+ #aaaaaa
1631
+
1632
+ Math on color objects is performed piecewise on the rgb
1633
+ components. However, these operations rarely have meaning in the
1634
+ design domain (mostly they make sense for gray-scale colors).
1635
+
1636
+ >> #aaa + #123
1637
+ #bbccdd
1638
+ >> #333 * 2
1639
+ #666666
1640
+
1641
+ #### Booleans
1642
+
1643
+ Boolean objects can be created by comparison operators or via the
1644
+ `true` and `false` keywords. Booleans can be combined using the
1645
+ `and`, `or`, and `not` keywords.
1646
+
1647
+ >> true
1648
+ true
1649
+ >> true and false
1650
+ false
1651
+ >> 5 < 10
1652
+ true
1653
+ >> not (5 < 10)
1654
+ false
1655
+ >> not (5 < 10) or not (10 < 5)
1656
+ true
1657
+ >> 30mm == 3cm
1658
+ true
1659
+ >> 1px == 1em
1660
+ false
1661
+
1662
+ #### Strings
1663
+
1664
+ Unicode escapes are now allowed within SassScript strings.
1665
+
1666
+ ### Control Directives
1667
+
1668
+ New directives provide branching and looping within a sass stylesheet
1669
+ based on SassScript expressions. See the [Sass
1670
+ Reference](SASS_REFERENCE.md.html#control_directives) for complete
1671
+ details.
1672
+
1673
+ #### @for
1674
+
1675
+ The `@for` directive loops over a set of numbers in sequence, defining
1676
+ the current number into the variable specified for each loop. The
1677
+ `through` keyword means that the last iteration will include the
1678
+ number, the `to` keyword means that it will stop just before that
1679
+ number.
1680
+
1681
+ @for !x from 1px through 5px
1682
+ .border-#{!x}
1683
+ border-width= !x
1684
+
1685
+ compiles to:
1686
+
1687
+ .border-1px {
1688
+ border-width: 1px; }
1689
+
1690
+ .border-2px {
1691
+ border-width: 2px; }
1692
+
1693
+ .border-3px {
1694
+ border-width: 3px; }
1695
+
1696
+ .border-4px {
1697
+ border-width: 4px; }
1698
+
1699
+ .border-5px {
1700
+ border-width: 5px; }
1701
+
1702
+ #### @if / @else if / @else
1703
+
1704
+ The branching directives `@if`, `@else if`, and `@else` let you select
1705
+ between several branches of sass to be emitted, based on the result of
1706
+ a SassScript expression. Example:
1707
+
1708
+ !type = "monster"
1709
+ p
1710
+ @if !type == "ocean"
1711
+ color: blue
1712
+ @else if !type == "matador"
1713
+ color: red
1714
+ @else if !type == "monster"
1715
+ color: green
1716
+ @else
1717
+ color: black
1718
+
1719
+ is compiled to:
1720
+
1721
+ p {
1722
+ color: green; }
1723
+
1724
+ #### @while
1725
+
1726
+ The `@while` directive lets you iterate until a condition is
1727
+ met. Example:
1728
+
1729
+ !i = 6
1730
+ @while !i > 0
1731
+ .item-#{!i}
1732
+ width = 2em * !i
1733
+ !i = !i - 2
1734
+
1735
+ is compiled to:
1736
+
1737
+ .item-6 {
1738
+ width: 12em; }
1739
+
1740
+ .item-4 {
1741
+ width: 8em; }
1742
+
1743
+ .item-2 {
1744
+ width: 4em; }
1745
+
1746
+ ### Variable Scoping
1747
+
1748
+ The term "constant" has been renamed to "variable." Variables can be
1749
+ declared at any scope (a.k.a. nesting level) and they will only be
1750
+ visible to the code until the next outdent. However, if a variable is
1751
+ already defined in a higher level scope, setting it will overwrite the
1752
+ value stored previously.
1753
+
1754
+ In this code, the `!local_var` variable is scoped and hidden from
1755
+ other higher level scopes or sibling scopes:
1756
+
1757
+ .foo
1758
+ .bar
1759
+ !local_var = 1px
1760
+ width= !local_var
1761
+ .baz
1762
+ // this will raise an undefined variable error.
1763
+ width= !local_var
1764
+ // as will this
1765
+ width= !local_var
1766
+
1767
+ In this example, since the `!global_var` variable is first declared at
1768
+ a higher scope, it is shared among all lower scopes:
1769
+
1770
+ !global_var = 1px
1771
+ .foo
1772
+ .bar
1773
+ !global_var = 2px
1774
+ width= !global_var
1775
+ .baz
1776
+ width= !global_var
1777
+ width= !global_var
1778
+
1779
+ compiles to:
1780
+
1781
+ .foo {
1782
+ width: 2px; }
1783
+ .foo .bar {
1784
+ width: 2px; }
1785
+ .foo .baz {
1786
+ width: 2px; }
1787
+
1788
+
1789
+ ### Interpolation
1790
+
1791
+ Interpolation has been added. This allows SassScript to be used to
1792
+ create dynamic properties and selectors. It also cleans up some uses
1793
+ of dynamic values when dealing with compound properties. Using
1794
+ interpolation, the result of a SassScript expression can be placed
1795
+ anywhere:
1796
+
1797
+ !x = 1
1798
+ !d = 3
1799
+ !property = "border"
1800
+ div.#{!property}
1801
+ #{!property}: #{!x + !d}px solid
1802
+ #{!property}-color: blue
1803
+
1804
+ is compiled to:
1805
+
1806
+ div.border {
1807
+ border: 4px solid;
1808
+ border-color: blue; }
1809
+
1810
+ ### Sass Functions
1811
+
1812
+ SassScript defines some useful functions that are called using the
1813
+ normal CSS function syntax:
1814
+
1815
+ p
1816
+ color = hsl(0, 100%, 50%)
1817
+
1818
+ is compiled to:
1819
+
1820
+ #main {
1821
+ color: #ff0000; }
1822
+
1823
+ The following functions are provided: `hsl`, `percentage`, `round`,
1824
+ `ceil`, `floor`, and `abs`. You can define additional functions in
1825
+ ruby.
1826
+
1827
+ See {Sass::Script::Functions} for more information.
1828
+
1829
+
1830
+ ### New Options
1831
+
1832
+ #### `:line_comments`
1833
+
1834
+ To aid in debugging, You may set the `:line_comments` option to
1835
+ `true`. This will cause the sass engine to insert a comment before
1836
+ each selector saying where that selector was defined in your sass
1837
+ code.
1838
+
1839
+ #### `:template_location`
1840
+
1841
+ The {Sass::Plugin} `:template_location` option now accepts a hash of
1842
+ sass paths to corresponding css paths. Please be aware that it is
1843
+ possible to import sass files between these separate locations -- they
1844
+ are not isolated from each other.
1845
+
1846
+ ### Miscellaneous Features
1847
+
1848
+ #### `@debug` Directive
1849
+
1850
+ The `@debug` directive accepts a SassScript expression and emits the
1851
+ value of that expression to the terminal (stderr).
1852
+
1853
+ Example:
1854
+
1855
+ @debug 1px + 2px
1856
+
1857
+ During compilation the following will be printed:
1858
+
1859
+ Line 1 DEBUG: 3px
1860
+
1861
+ #### Ruby 1.9 Support
1862
+
1863
+ Sass now fully supports Ruby 1.9.1.
1864
+
1865
+ #### Sass Cache
1866
+
1867
+ By default, Sass caches compiled templates and
1868
+ [partials](SASS_REFERENCE.md.html#partials). This dramatically speeds
1869
+ up re-compilation of large collections of Sass files, and works best
1870
+ if the Sass templates are split up into separate files that are all
1871
+ [`@import`](SASS_REFERENCE.md.html#import)ed into one large file.
1872
+
1873
+ Without a framework, Sass puts the cached templates in the
1874
+ `.sass-cache` directory. In Rails and Merb, they go in
1875
+ `tmp/sass-cache`. The directory can be customized with the
1876
+ [`:cache_location`](#cache_location-option) option. If you don't want
1877
+ Sass to use caching at all, set the [`:cache`](#cache-option) option
1878
+ to `false`.