haml 3.2.0.alpha.10 → 3.2.0.alpha.13

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

Potentially problematic release.


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

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