Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 21402 Bytes
1 | # Sass Changelog |
2 | |
3 | * Table of contents |
4 | {:toc} |
5 | |
6 | ## 2.2.24 |
7 | |
8 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24). |
9 | |
10 | * Parent references -- the `&` character -- |
11 | may only be placed at the beginning of simple selector sequences in Sass 3. |
12 | Placing them elsewhere is deprecated in 2.2.24 and will print a warning. |
13 | For example, `foo &.bar` is allowed, but `foo .bar&` is not. |
14 | |
15 | ## 2.2.23 |
16 | |
17 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23). |
18 | |
19 | * Don't crash when `rake gems` is run in Rails with Sass installed. |
20 | Thanks to [Florian Frank](http://github.com/flori). |
21 | |
22 | * When raising a file-not-found error, |
23 | add a list of load paths that were checked. |
24 | |
25 | * If an import isn't found for a cached Sass file and the |
26 | {file:SASS_REFERENCE.md#full_exception `:full_exception option`} is enabled, |
27 | print the full exception rather than raising it. |
28 | |
29 | * Fix a bug with a weird interaction with Haml, DataMapper, and Rails 3 |
30 | that caused some tag helpers to go into infinite recursion. |
31 | |
32 | ## 2.2.22 |
33 | |
34 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22). |
35 | |
36 | * Add a railtie so Haml and Sass will be automatically loaded in Rails 3. |
37 | Thanks to [Daniel Neighman](http://pancakestacks.wordpress.com/). |
38 | |
39 | * Make loading the gemspec not crash on read-only filesystems like Heroku's. |
40 | |
41 | ## 2.2.21 |
42 | |
43 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.21). |
44 | |
45 | * Fix a few bugs in the git-revision-reporting in {Haml::Version#version}. |
46 | In particular, it will still work if `git gc` has been called recently, |
47 | or if various files are missing. |
48 | |
49 | * Always use `__FILE__` when reading files within the Haml repo in the `Rakefile`. |
50 | According to [this bug report](http://github.com/carlhuda/bundler/issues/issue/44), |
51 | this should make Sass work better with Bundler. |
52 | |
53 | ## 2.2.20 |
54 | |
55 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.20). |
56 | |
57 | * If the cache file for a given Sass file is corrupt |
58 | because it doesn't have enough content, |
59 | produce a warning and read the Sass file |
60 | rather than letting the exception bubble up. |
61 | This is consistent with other sorts of sassc corruption handling. |
62 | |
63 | * Calls to `defined?` shouldn't interfere with Rails' autoloading |
64 | in very old versions (1.2.x). |
65 | |
66 | ## 2.2.19 |
67 | |
68 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18). |
69 | |
70 | There were no changes made to Sass between versions 2.2.18 and 2.2.19. |
71 | |
72 | ## 2.2.18 |
73 | |
74 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18). |
75 | |
76 | * Use `Rails.env` rather than `RAILS_ENV` when running under Rails 3.0. |
77 | Thanks to [Duncan Grazier](http://duncangrazier.com/). |
78 | |
79 | * Support `:line_numbers` as an alias for {file:SASS_REFERENCE.md#line_numbers-option `:line_comments`}, |
80 | since that's what the docs have said forever. |
81 | Similarly, support `--line-numbers` as a command-line option. |
82 | |
83 | * Add a `--unix-newlines` flag to all executables |
84 | for outputting Unix-style newlines on Windows. |
85 | |
86 | * Add a {file:SASS_REFERENCE.md#unix_newlines-option `:unix_newlines` option} |
87 | for {Sass::Plugin} for outputting Unix-style newlines on Windows. |
88 | |
89 | * Fix the `--cache-location` flag, which was previously throwing errors. |
90 | Thanks to [tav](http://tav.espians.com/). |
91 | |
92 | * Allow comments at the beginning of the document to have arbitrary indentation, |
93 | just like comments elsewhere. |
94 | Similarly, comment parsing is a little nicer than before. |
95 | |
96 | ## 2.2.17 |
97 | |
98 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16). |
99 | |
100 | * When the {file:SASS_REFERENCE.md#full_exception-option `:full_exception` option} |
101 | is false, raise the error in Ruby code rather than swallowing it |
102 | and printing something uninformative. |
103 | |
104 | * Fixed error-reporting when something goes wrong when loading Sass |
105 | using the `sass` executable. |
106 | This used to raise a NameError because `Sass::SyntaxError` wasn't defined. |
107 | Now it'll raise the correct exception instead. |
108 | |
109 | * Report the filename in warnings about selectors without properties. |
110 | |
111 | * `nil` values for Sass options are now ignored, |
112 | rather than raising errors. |
113 | |
114 | * Fix a bug that appears when Plugin template locations |
115 | have multiple trailing slashes. |
116 | Thanks to [Jared Grippe](http://jaredgrippe.com/). |
117 | |
118 | ### Must Read! |
119 | |
120 | * When `@import` is given a filename without an extension, |
121 | the behavior of rendering a CSS `@import` if no Sass file is found |
122 | is deprecated. |
123 | In future versions, `@import foo` will either import the template |
124 | or raise an error. |
125 | |
126 | ## 2.2.16 |
127 | |
128 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16). |
129 | |
130 | * Fixed a bug where modules containing user-defined Sass functions |
131 | weren't made available when simply included in {Sass::Script::Functions} |
132 | ({Sass::Script::Functions Functions} needed to be re-included in |
133 | {Sass::Script::Functions::EvaluationContext Functions::EvaluationContext}). |
134 | Now the module simply needs to be included in {Sass::Script::Functions}. |
135 | |
136 | ## 2.2.15 |
137 | |
138 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.15). |
139 | |
140 | * Added {Sass::Script::Color#with} for a way of setting color channels |
141 | that's easier than manually constructing a new color |
142 | and is forwards-compatible with alpha-channel colors |
143 | (to be introduced in Sass 2.4). |
144 | |
145 | * Added a missing require in Sass that caused crashes |
146 | when it was being run standalone. |
147 | |
148 | ## 2.2.14 |
149 | |
150 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.14). |
151 | |
152 | * All Sass functions now raise explicit errors if their inputs |
153 | are of the incorrect type. |
154 | |
155 | * Allow the SassScript `rgb()` function to take percentages |
156 | in addition to numerical values. |
157 | |
158 | * Fixed a bug where SassScript strings with `#` followed by `#{}` interpolation |
159 | didn't evaluate the interpolation. |
160 | |
161 | ### SassScript Ruby API |
162 | |
163 | These changes only affect people defining their own Sass functions |
164 | using {Sass::Script::Functions}. |
165 | |
166 | * {Sass::Script::Color#value} attribute is deprecated. |
167 | Use {Sass::Script::Color#rgb} instead. |
168 | The returned array is now frozen as well. |
169 | |
170 | * Add an `assert_type` function that's available to {Sass::Script::Functions}. |
171 | This is useful for typechecking the inputs to functions. |
172 | |
173 | ### Rack Support |
174 | |
175 | Sass 2.2.14 includes Rack middleware for running Sass, |
176 | meaning that all Rack-enabled frameworks can now use Sass. |
177 | To activate this, just add |
178 | |
179 | require 'sass/plugin/rack' |
180 | use Sass::Plugin::Rack |
181 | |
182 | to your `config.ru`. |
183 | See the {Sass::Plugin::Rack} documentation for more details. |
184 | |
185 | ## 2.2.13 |
186 | |
187 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.13). |
188 | |
189 | There were no changes made to Sass between versions 2.2.12 and 2.2.13. |
190 | |
191 | ## 2.2.12 |
192 | |
193 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.12). |
194 | |
195 | * Fix a stupid bug introduced in 2.2.11 that broke the Sass Rails plugin. |
196 | |
197 | ## 2.2.11 |
198 | |
199 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.11). |
200 | |
201 | * Added a note to errors on properties that could be pseudo-classes (e.g. `:focus`) |
202 | indicating that they should be backslash-escaped. |
203 | |
204 | * Automatically interpret properties that could be pseudo-classes as such |
205 | if {file:SASS_REFERENCE.md.html#property_syntax-option `:property_syntax`} |
206 | is set to `:new`. |
207 | |
208 | * Fixed `css2sass`'s generation of pseudo-classes so that they're backslash-escaped. |
209 | |
210 | * Don't crash if the Haml plugin skeleton is installed and `rake gems:install` is run. |
211 | |
212 | * Don't use `RAILS_ROOT` directly. |
213 | This no longer exists in Rails 3.0. |
214 | Instead abstract this out as `Haml::Util.rails_root`. |
215 | This changes makes Haml fully compatible with edge Rails as of this writing. |
216 | |
217 | * Make use of a Rails callback rather than a monkeypatch to check for stylesheet updates |
218 | in Rails 3.0+. |
219 | |
220 | ## 2.2.10 |
221 | |
222 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.10). |
223 | |
224 | * Add support for attribute selectors with spaces around the `=`. |
225 | For example: |
226 | |
227 | a[href = http://google.com] |
228 | color: blue |
229 | |
230 | ## 2.2.9 |
231 | |
232 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.9). |
233 | |
234 | There were no changes made to Sass between versions 2.2.8 and 2.2.9. |
235 | |
236 | ## 2.2.8 |
237 | |
238 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.8). |
239 | |
240 | There were no changes made to Sass between versions 2.2.7 and 2.2.8. |
241 | |
242 | ## 2.2.7 |
243 | |
244 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.7). |
245 | |
246 | There were no changes made to Sass between versions 2.2.6 and 2.2.7. |
247 | |
248 | ## 2.2.6 |
249 | |
250 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.6). |
251 | |
252 | * Don't crash when the `__FILE__` constant of a Ruby file is a relative path, |
253 | as apparently happens sometimes in TextMate |
254 | (thanks to [Karl Varga](http://github.com/kjvarga)). |
255 | |
256 | * Add "Sass" to the `--version` string for the executables. |
257 | |
258 | ## 2.2.5 |
259 | |
260 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.5). |
261 | |
262 | There were no changes made to Sass between versions 2.2.4 and 2.2.5. |
263 | |
264 | ## 2.2.4 |
265 | |
266 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.4). |
267 | |
268 | * Don't add `require 'rubygems'` to the top of init.rb when installed |
269 | via `sass --rails`. This isn't necessary, and actually gets |
270 | clobbered as soon as haml/template is loaded. |
271 | |
272 | * Document the previously-undocumented {file:SASS_REFERENCE.md#line-option `:line` option}, |
273 | which allows the number of the first line of a Sass file to be set for error reporting. |
274 | |
275 | ## 2.2.3 |
276 | |
277 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.3). |
278 | |
279 | Sass 2.2.3 prints line numbers for warnings about selectors |
280 | with no properties. |
281 | |
282 | ## 2.2.2 |
283 | |
284 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.2). |
285 | |
286 | Sass 2.2.2 is a minor bug-fix release. |
287 | Notable changes include better parsing of mixin definitions and inclusions |
288 | and better support for Ruby 1.9. |
289 | |
290 | ## 2.2.1 |
291 | |
292 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.1). |
293 | |
294 | Sass 2.2.1 is a minor bug-fix release. |
295 | |
296 | ### Must Read! |
297 | |
298 | * It used to be acceptable to use `-` immediately following variable names, |
299 | without any whitespace in between (for example, `!foo-!bar`). |
300 | This is now deprecated, so that in the future variables with hyphens |
301 | can be supported. Surround `-` with spaces. |
302 | |
303 | ## 2.2.0 |
304 | |
305 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.0). |
306 | |
307 | The 2.2 release marks a significant step in the evolution of the Sass |
308 | language. The focus has been to increase the power of Sass to keep |
309 | your stylesheets maintainable by allowing new forms of abstraction to |
310 | be created within your stylesheets and the stylesheets provided by |
311 | others that you can download and import into your own. The fundamental |
312 | units of abstraction in Sass are variables and mixins. Please read |
313 | below for a list of changes: |
314 | |
315 | ### Must Read! |
316 | |
317 | * Sass Comments (//) used to only comment out a single line. This was deprecated |
318 | in 2.0.10 and starting in 2.2, Sass comments will comment out any lines indented |
319 | under them. Upgrade to 2.0.10 in order to see deprecation warnings where this change |
320 | affects you. |
321 | |
322 | * Implicit Strings within SassScript are now deprecated and will be removed in 2.4. |
323 | For example: `border= !width solid #00F` should now be written as `border: #{!width} solid #00F` |
324 | or as `border= !width "solid" #00F`. After upgrading to 2.2, you will see deprecation warnings |
325 | if you have sass files that use implicit strings. |
326 | |
327 | |
328 | ### Sass Syntax Changes |
329 | |
330 | #### Flexible Indentation |
331 | |
332 | The indentation of Sass documents is now flexible. The first indent |
333 | that is detected will determine the indentation style for that |
334 | document. Tabs and spaces may never be mixed, but within a document, |
335 | you may choose to use tabs or a flexible number of spaces. |
336 | |
337 | #### Multiline Sass Comments |
338 | |
339 | Sass Comments (//) will now comment out whatever is indented beneath |
340 | them. Previously they were single line when used at the top level of a |
341 | document. Upgrading to the latest stable version will give you |
342 | deprecation warnings if you have silent comments with indentation |
343 | underneath them. |
344 | |
345 | #### Mixin Arguments |
346 | |
347 | Sass Mixins now accept any number of arguments. To define a mixin with |
348 | arguments, specify the arguments as a comma-delimited list of |
349 | variables like so: |
350 | |
351 | =my-mixin(!arg1, !arg2, !arg3) |
352 | |
353 | As before, the definition of the mixin is indented below the mixin |
354 | declaration. The variables declared in the argument list may be used |
355 | and will be bound to the values passed to the mixin when it is |
356 | invoked. Trailing arguments may have default values as part of the |
357 | declaration: |
358 | |
359 | =my-mixin(!arg1, !arg2 = 1px, !arg3 = blue) |
360 | |
361 | In the example above, the mixin may be invoked by passing 1, 2 or 3 |
362 | arguments to it. A similar syntax is used to invoke a mixin that |
363 | accepts arguments: |
364 | |
365 | div.foo |
366 | +my-mixin(1em, 3px) |
367 | |
368 | When a mixin has no required arguments, the parenthesis are optional. |
369 | |
370 | The default values for mixin arguments are evaluated in the global |
371 | context at the time when the mixin is invoked, they may also reference |
372 | the previous arguments in the declaration. For example: |
373 | |
374 | !default_width = 30px |
375 | =my-fancy-mixin(!width = !default_width, !height = !width) |
376 | width= !width |
377 | height= !height |
378 | |
379 | .default-box |
380 | +my-fancy-mixin |
381 | |
382 | .square-box |
383 | +my-fancy-mixin(50px) |
384 | |
385 | .rectangle-box |
386 | +my-fancy-mixin(25px, 75px) |
387 | |
388 | !default_width = 10px |
389 | .small-default-box |
390 | +my-fancy-mixin |
391 | |
392 | |
393 | compiles to: |
394 | |
395 | .default-box { |
396 | width: 30px; |
397 | height: 30px; } |
398 | |
399 | .square-box { |
400 | width: 50px; |
401 | height: 50px; } |
402 | |
403 | .rectangle-box { |
404 | width: 25px; |
405 | height: 75px; } |
406 | |
407 | .small-default-box { |
408 | width: 10px; |
409 | height: 10px; } |
410 | |
411 | |
412 | ### Sass, Interactive |
413 | |
414 | The sass command line option -i now allows you to quickly and |
415 | interactively experiment with SassScript expressions. The value of the |
416 | expression you enter will be printed out after each line. Example: |
417 | |
418 | $ sass -i |
419 | >> 5px |
420 | 5px |
421 | >> 5px + 10px |
422 | 15px |
423 | >> !five_pixels = 5px |
424 | 5px |
425 | >> !five_pixels + 10px |
426 | 15px |
427 | |
428 | ### SassScript |
429 | |
430 | The features of SassScript have been greatly enhanced with new control |
431 | directives, new fundamental data types, and variable scoping. |
432 | |
433 | #### New Data Types |
434 | |
435 | SassScript now has four fundamental data types: |
436 | |
437 | 1. Number |
438 | 2. String |
439 | 3. Boolean (New in 2.2) |
440 | 4. Colors |
441 | |
442 | #### More Flexible Numbers |
443 | |
444 | Like JavaScript, SassScript numbers can now change between floating |
445 | point and integers. No explicit casting or decimal syntax is |
446 | required. When a number is emitted into a CSS file it will be rounded |
447 | to the nearest thousandth, however the internal representation |
448 | maintains much higher precision. |
449 | |
450 | #### Improved Handling of Units |
451 | |
452 | While Sass has long supported numbers with units, it now has a much |
453 | deeper understanding of them. The following are examples of legal |
454 | numbers in SassScript: |
455 | |
456 | 0, 1000, 6%, -2px, 5pc, 20em, or 2foo. |
457 | |
458 | Numbers of the same unit may always be added and subtracted. Numbers |
459 | that have units that Sass understands and finds comparable, can be |
460 | combined, taking the unit of the first number. Numbers that have |
461 | non-comparable units may not be added nor subtracted -- any attempt to |
462 | do so will cause an error. However, a unitless number takes on the |
463 | unit of the other number during a mathematical operation. For example: |
464 | |
465 | >> 3mm + 4cm |
466 | 43mm |
467 | >> 4cm + 3mm |
468 | 4.3cm |
469 | >> 3cm + 2in |
470 | 8.08cm |
471 | >> 5foo + 6foo |
472 | 11foo |
473 | >> 4% + 5px |
474 | SyntaxError: Incompatible units: 'px' and '%'. |
475 | >> 5 + 10px |
476 | 15px |
477 | |
478 | Sass allows compound units to be stored in any intermediate form, but |
479 | will raise an error if you try to emit a compound unit into your css |
480 | file. |
481 | |
482 | >> !em_ratio = 1em / 16px |
483 | 0.063em/px |
484 | >> !em_ratio * 32px |
485 | 2em |
486 | >> !em_ratio * 40px |
487 | 2.5em |
488 | |
489 | #### Colors |
490 | |
491 | A color value can be declared using a color name, hexadecimal, |
492 | shorthand hexadecimal, the rgb function, or the hsl function. When |
493 | outputting a color into css, the color name is used, if any, otherwise |
494 | it is emitted as hexadecimal value. Examples: |
495 | |
496 | > #fff |
497 | white |
498 | >> white |
499 | white |
500 | >> #FFFFFF |
501 | white |
502 | >> hsl(180, 100, 100) |
503 | white |
504 | >> rgb(255, 255, 255) |
505 | white |
506 | >> #AAA |
507 | #aaaaaa |
508 | |
509 | Math on color objects is performed piecewise on the rgb |
510 | components. However, these operations rarely have meaning in the |
511 | design domain (mostly they make sense for gray-scale colors). |
512 | |
513 | >> #aaa + #123 |
514 | #bbccdd |
515 | >> #333 * 2 |
516 | #666666 |
517 | |
518 | #### Booleans |
519 | |
520 | Boolean objects can be created by comparison operators or via the |
521 | `true` and `false` keywords. Booleans can be combined using the |
522 | `and`, `or`, and `not` keywords. |
523 | |
524 | >> true |
525 | true |
526 | >> true and false |
527 | false |
528 | >> 5 < 10 |
529 | true |
530 | >> not (5 < 10) |
531 | false |
532 | >> not (5 < 10) or not (10 < 5) |
533 | true |
534 | >> 30mm == 3cm |
535 | true |
536 | >> 1px == 1em |
537 | false |
538 | |
539 | #### Strings |
540 | |
541 | Unicode escapes are now allowed within SassScript strings. |
542 | |
543 | ### Control Directives |
544 | |
545 | New directives provide branching and looping within a sass stylesheet |
546 | based on SassScript expressions. See the [Sass |
547 | Reference](SASS_REFERENCE.md.html#control_directives) for complete |
548 | details. |
549 | |
550 | #### @for |
551 | |
552 | The `@for` directive loops over a set of numbers in sequence, defining |
553 | the current number into the variable specified for each loop. The |
554 | `through` keyword means that the last iteration will include the |
555 | number, the `to` keyword means that it will stop just before that |
556 | number. |
557 | |
558 | @for !x from 1px through 5px |
559 | .border-#{!x} |
560 | border-width= !x |
561 | |
562 | compiles to: |
563 | |
564 | .border-1px { |
565 | border-width: 1px; } |
566 | |
567 | .border-2px { |
568 | border-width: 2px; } |
569 | |
570 | .border-3px { |
571 | border-width: 3px; } |
572 | |
573 | .border-4px { |
574 | border-width: 4px; } |
575 | |
576 | .border-5px { |
577 | border-width: 5px; } |
578 | |
579 | #### @if / @else if / @else |
580 | |
581 | The branching directives `@if`, `@else if`, and `@else` let you select |
582 | between several branches of sass to be emitted, based on the result of |
583 | a SassScript expression. Example: |
584 | |
585 | !type = "monster" |
586 | p |
587 | @if !type == "ocean" |
588 | color: blue |
589 | @else if !type == "matador" |
590 | color: red |
591 | @else if !type == "monster" |
592 | color: green |
593 | @else |
594 | color: black |
595 | |
596 | is compiled to: |
597 | |
598 | p { |
599 | color: green; } |
600 | |
601 | #### @while |
602 | |
603 | The `@while` directive lets you iterate until a condition is |
604 | met. Example: |
605 | |
606 | !i = 6 |
607 | @while !i > 0 |
608 | .item-#{!i} |
609 | width = 2em * !i |
610 | !i = !i - 2 |
611 | |
612 | is compiled to: |
613 | |
614 | .item-6 { |
615 | width: 12em; } |
616 | |
617 | .item-4 { |
618 | width: 8em; } |
619 | |
620 | .item-2 { |
621 | width: 4em; } |
622 | |
623 | ### Variable Scoping |
624 | |
625 | The term "constant" has been renamed to "variable." Variables can be |
626 | declared at any scope (a.k.a. nesting level) and they will only be |
627 | visible to the code until the next outdent. However, if a variable is |
628 | already defined in a higher level scope, setting it will overwrite the |
629 | value stored previously. |
630 | |
631 | In this code, the `!local_var` variable is scoped and hidden from |
632 | other higher level scopes or sibling scopes: |
633 | |
634 | .foo |
635 | .bar |
636 | !local_var = 1px |
637 | width= !local_var |
638 | .baz |
639 | // this will raise an undefined variable error. |
640 | width= !local_var |
641 | // as will this |
642 | width= !local_var |
643 | |
644 | In this example, since the `!global_var` variable is first declared at |
645 | a higher scope, it is shared among all lower scopes: |
646 | |
647 | !global_var = 1px |
648 | .foo |
649 | .bar |
650 | !global_var = 2px |
651 | width= !global_var |
652 | .baz |
653 | width= !global_var |
654 | width= !global_var |
655 | |
656 | compiles to: |
657 | |
658 | .foo { |
659 | width: 2px; } |
660 | .foo .bar { |
661 | width: 2px; } |
662 | .foo .baz { |
663 | width: 2px; } |
664 | |
665 | |
666 | ### Interpolation |
667 | |
668 | Interpolation has been added. This allows SassScript to be used to |
669 | create dynamic properties and selectors. It also cleans up some uses |
670 | of dynamic values when dealing with compound properties. Using |
671 | interpolation, the result of a SassScript expression can be placed |
672 | anywhere: |
673 | |
674 | !x = 1 |
675 | !d = 3 |
676 | !property = "border" |
677 | div.#{!property} |
678 | #{!property}: #{!x + !d}px solid |
679 | #{!property}-color: blue |
680 | |
681 | is compiled to: |
682 | |
683 | div.border { |
684 | border: 4px solid; |
685 | border-color: blue; } |
686 | |
687 | ### Sass Functions |
688 | |
689 | SassScript defines some useful functions that are called using the |
690 | normal CSS function syntax: |
691 | |
692 | p |
693 | color = hsl(0, 100%, 50%) |
694 | |
695 | is compiled to: |
696 | |
697 | #main { |
698 | color: #ff0000; } |
699 | |
700 | The following functions are provided: `hsl`, `percentage`, `round`, |
701 | `ceil`, `floor`, and `abs`. You can define additional functions in |
702 | ruby. |
703 | |
704 | See {Sass::Script::Functions} for more information. |
705 | |
706 | |
707 | ### New Options |
708 | |
709 | #### `:line_comments` |
710 | |
711 | To aid in debugging, You may set the `:line_comments` option to |
712 | `true`. This will cause the sass engine to insert a comment before |
713 | each selector saying where that selector was defined in your sass |
714 | code. |
715 | |
716 | #### `:template_location` |
717 | |
718 | The {Sass::Plugin} `:template_location` option now accepts a hash of |
719 | sass paths to corresponding css paths. Please be aware that it is |
720 | possible to import sass files between these separate locations -- they |
721 | are not isolated from each other. |
722 | |
723 | ### Miscellaneous Features |
724 | |
725 | #### `@debug` Directive |
726 | |
727 | The `@debug` directive accepts a SassScript expression and emits the |
728 | value of that expression to the terminal (stderr). |
729 | |
730 | Example: |
731 | |
732 | @debug 1px + 2px |
733 | |
734 | During compilation the following will be printed: |
735 | |
736 | Line 1 DEBUG: 3px |
737 | |
738 | #### Ruby 1.9 Support |
739 | |
740 | Sass now fully supports Ruby 1.9.1. |
741 | |
742 | #### Sass Cache |
743 | |
744 | By default, Sass caches compiled templates and |
745 | [partials](SASS_REFERENCE.md.html#partials). This dramatically speeds |
746 | up re-compilation of large collections of Sass files, and works best |
747 | if the Sass templates are split up into separate files that are all |
748 | [`@import`](SASS_REFERENCE.md.html#import)ed into one large file. |
749 | |
750 | Without a framework, Sass puts the cached templates in the |
751 | `.sass-cache` directory. In Rails and Merb, they go in |
752 | `tmp/sass-cache`. The directory can be customized with the |
753 | [`:cache_location`](#cache_location-option) option. If you don't want |
754 | Sass to use caching at all, set the [`:cache`](#cache-option) option |
755 | to `false`. |