README.md in sprockets-sass-1.3.1 vs README.md in sprockets-sass-2.0.0.beta1
- old
+ new
@@ -1,17 +1,19 @@
sprockets-sass
==============
+[![Gem Version](https://badge.fury.io/rb/sprockets-sass.svg)](https://badge.fury.io/rb/sprockets-sass) [![Build Status](https://travis-ci.org/petebrowne/sprockets-sass.svg?branch=master)](https://travis-ci.org/petebrowne/sprockets-sass)
+
**Better Sass integration with [Sprockets 2.x](http://github.com/sstephenson/sprockets)**
When using Sprockets 2.x with Sass you will eventually run into a pretty big issue. `//= require` directives will not allow Sass mixins, variables, etc. to be shared between files. So you'll try to use `@import`, and that'll also blow up in your face. `sprockets-sass` fixes all of this by creating a Sass::Importer that is Sprockets aware.
-_Note: This works in Rails 3.1, thanks to the [sass-rails gem](http://github.com/rails/sass-rails). But if you want to use Sprockets and Sass anywhere else, like Sinatra, use `sprockets-sass`._
+**Note: This works in Rails 3.1, thanks to the [sass-rails gem](http://github.com/rails/sass-rails). But if you want to use Sprockets and Sass anywhere else, like Sinatra, use `sprockets-sass`**
### Features
-* Imports Sass _partials_ (filenames prepended with "_").
+* Imports Sass ```_partials_``` (filenames prepended with ```_```).
* Import paths work exactly like `require` directives.
* Imports either Sass syntax, or just regular CSS files.
* Imported files are preprocessed by Sprockets, so `.css.scss.erb` files can be imported.
Directives from within imported files also work as expected.
* Automatic integration with Compass.
@@ -46,10 +48,28 @@
map "/" do
run YourRackApp
end
```
+Sprockets Sass provides also a compressor for ```.css``` files
+
+You can use it with Sprockets 2.x by doing this:
+
+```ruby
+ environment = Sprockets::Environment.new
+ environment.css_compressor = Sprockets::Sass::V2::Compressor
+```
+
+Or with Sprockets 3.x by doing this:
+
+```ruby
+ environment = Sprockets::Environment.new
+ environment.css_compressor = :sprockets_sass
+```
+
+Or with Rails by setting ```css_compressor``` in the ```config/application.rb``` file to one of the values listed above depending on your version of Sprockets
+
Now `@import` works essentially just like a `require` directive, but with one essential bonus:
Sass mixins, variables, etc. work as expected.
Given the following Sass _partials_:
@@ -156,17 +176,17 @@
require "sass"
map "/assets" do
environment = Sprockets::Environment.new
environment.append_path "assets/stylesheets"
-
+
Sprockets::Helpers.configure do |config|
config.environment = environment
config.prefix = "/assets"
config.digest = false
end
-
+
run environment
end
# etc...
```
@@ -189,9 +209,26 @@
``` scss
background: asset-data-uri("image.jpg"); // background: url(data:image/jpeg;base64,...);
```
+
+Development
+-----------
+
+Install dependencies using bundler:
+
+``` bash
+bundle install
+```
+
+sprocket-sass is tested against numerous versions of Sass, Compoass, and Sprockets using [appraisal](https://github.com/thoughtbot/appraisal).
+This will install all the gems and run the tests against all versions
+Run tests:
+
+``` bash
+bundle exec rake
+```
Copyright
---------
Copyright (c) 2011 [Peter Browne](http://petebrowne.com). See LICENSE for details.