haml_ejs 0.0.1

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