From 527bb905e3dfad8c19f2a3bc5ec06be101babe61 Mon Sep 17 00:00:00 2001 From: Michael Kessler Date: Sun, 4 Sep 2011 11:36:51 +0200 Subject: [PATCH] Describe new options in the README. --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ffaca6b..dcfaae3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ guard-sass compiles your sass (and scss) files automatically when changed. ## Install -You will need to have [guard](http://github.com/guard/guard) to continue, so install it now!. +You will need to have [guard](http://github.com/guard/guard) to continue, so install it now! Install the gem with: @@ -18,7 +18,6 @@ And finally add a basic setup to your Guardfile with: guard init sass - ## Usage ```ruby @@ -49,7 +48,7 @@ guard 'sass', :input => 'sass', :output => 'styles' guard 'sass', :input => 'stylesheets' ``` -These are equivelant to +These are equivalent to ```ruby guard 'sass', :output => 'styles' do @@ -61,25 +60,63 @@ guard 'sass' do end ``` +### With the Rails asset pipeline + +With the introduction of the [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html) +in Rails 3.1 there is no need to compile your Sass stylesheets with this Guard. However if you +like to have instant validation feedback (preferably with a Growl notification) directly after +you save a change, then you may want still use this Guard and just skip the generation of the +output file: + +```ruby +guard 'sass', :input => 'app/assets/stylesheets', :noop => true +``` + +This give you a faster compilation feedback compared to making a subsequent request to your +Rails application. If you just want to be notified when an error occurs you can hide the +success compilation message: + +```ruby +guard 'sass', :input => 'app/assets/stylesheets', :noop => true, :hide_success => true +``` ## Options +There following options can be passed to guard-sass: + ```ruby -:input => 'sass' # Relative path to the input directory -:output => 'css' # Relative path to the output directory -:notification => false # Whether to display notifications after finished, - # default: true -:shallow => true # Whether to output nested directories or just put css - # directly in output folder, default: false -:style => :nested # Controls the output style, by default :nested - # accepted options are :nested, :compact, :compressed and :expanded -:load_paths => ['sass/partials'] # Paths for sass to find imported sass files from, - # default: all directories under current -:debug_info_ => true # File and line number info for FireSass, default: false +:input => 'sass' # Relative path to the input directory. + # A suffix `/(.+\.s[ac]ss)` will be added to this option. + # default: nil + +:output => 'css' # Relative path to the output directory. + # default: the path given with the :input option + +:notification => false # Whether to display success and error notifications after finished. + # default: true + +:hide_success => true # Disable successful compilation messages. + # default: false + +:shallow => true # Do not create nested output directories. + # default: false + +:style => :nested # Controls the output style. + # Accepted options are :nested, :compact, :compressed and :expanded + # default: :nested + +:load_paths => ['sass/partials'] # Paths for sass to find imported sass files from. + # default: all directories under current + +:noop => true # No operation: Do not write output file + # default: false + +:debug_info_ => true # File and line number info for FireSass. + # default: false ``` ## [Contributors](https://github.com/hawx/guard-sass/contributors) -[gcs]: http://github.com/netzpirat/guard-coffeescript "guard-coffeescript" \ No newline at end of file +[gcs]: http://github.com/netzpirat/guard-coffeescript "guard-coffeescript"