mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Document caching.
This commit is contained in:
parent
3847bea2aa
commit
1db2fbc5a1
2 changed files with 16 additions and 4 deletions
1
TODO
1
TODO
|
@ -8,7 +8,6 @@
|
||||||
CSS Terminology (https://mail.google.com/mail/#label/Haml/1202d75234b3ce6b)
|
CSS Terminology (https://mail.google.com/mail/#label/Haml/1202d75234b3ce6b)
|
||||||
Convert to new property syntax
|
Convert to new property syntax
|
||||||
Stop calling it "alternate" - call it "new" instead
|
Stop calling it "alternate" - call it "new" instead
|
||||||
Document sassc somewhere obvious
|
|
||||||
** FAQ
|
** FAQ
|
||||||
form_for needs -, not =
|
form_for needs -, not =
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,19 @@ and using Sass::Engine like so:
|
||||||
engine = Sass::Engine.new("#main\n :background-color #0000ff")
|
engine = Sass::Engine.new("#main\n :background-color #0000ff")
|
||||||
engine.render #=> "#main { background-color: #0000ff; }\n"
|
engine.render #=> "#main { background-color: #0000ff; }\n"
|
||||||
|
|
||||||
|
### Caching
|
||||||
|
|
||||||
|
By default, Sass caches compiled templates and [partials](#partials).
|
||||||
|
This dramatically speeds up re-compilation of large collections of Sass files,
|
||||||
|
and works best if the Sass templates are split up into separate files
|
||||||
|
that are all [`@import`](#import)ed into one large file.
|
||||||
|
|
||||||
|
Without a framework, Sass puts the cached templates in the `.sass-cache` directory.
|
||||||
|
In Rails and Merb, they go in `tmp/sass-cache`.
|
||||||
|
The directory can be customized with the [`:cache_location`](#cache_location-option) option.
|
||||||
|
If you don't want Sass to use caching at all,
|
||||||
|
set the [`:cache`](#cache-option) option to `false`.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
Options can be set by setting the {Sass::Plugin#options Sass::Plugin.options} hash
|
Options can be set by setting the {Sass::Plugin#options Sass::Plugin.options} hash
|
||||||
|
@ -163,7 +176,7 @@ Available options are:
|
||||||
|
|
||||||
{#load_paths-option} `:load_paths`
|
{#load_paths-option} `:load_paths`
|
||||||
: An array of filesystem paths which should be searched
|
: An array of filesystem paths which should be searched
|
||||||
for Sass templates imported with the "@import" directive.
|
for Sass templates imported with the [`@import`](#import) directive.
|
||||||
This defaults to the working directory and, in Rails or Merb,
|
This defaults to the working directory and, in Rails or Merb,
|
||||||
whatever `:template_location` is.
|
whatever `:template_location` is.
|
||||||
|
|
||||||
|
@ -399,7 +412,7 @@ Some directives can also control whether or how many times
|
||||||
a chunk of Sass is output.
|
a chunk of Sass is output.
|
||||||
Those are documented under Control Structures.
|
Those are documented under Control Structures.
|
||||||
|
|
||||||
### `@import`
|
### `@import` {#import}
|
||||||
|
|
||||||
The `@import` directive works in a very similar way to the CSS import directive.
|
The `@import` directive works in a very similar way to the CSS import directive.
|
||||||
It can either compile to a literal CSS `@import` directive for a CSS file,
|
It can either compile to a literal CSS `@import` directive for a CSS file,
|
||||||
|
@ -442,7 +455,7 @@ Finally,
|
||||||
might compile to either,
|
might compile to either,
|
||||||
depending on whether or not a file called "foo.sass" existed.
|
depending on whether or not a file called "foo.sass" existed.
|
||||||
|
|
||||||
#### Partials
|
#### Partials {#partials}
|
||||||
|
|
||||||
If you have a Sass file that you want to import
|
If you have a Sass file that you want to import
|
||||||
but don't want to compile to a CSS file,
|
but don't want to compile to a CSS file,
|
||||||
|
|
Loading…
Add table
Reference in a new issue