Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Asset hosts with SASS/SCSS

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 sasset.gemspec
README.md

Sasset

Asset hosts with SASS/SCSS

Installation

Add this to your Gemfile:

gem 'sasset'

Then run bundle install.

Usage

First, in your config/application.rb file, set your asset host.

Sasset.asset_host = 'http://example.com'

This can also be a Proc. It works the same way as ActionController::Base.asset_host so feel free to set them to the same thing. See ActionView::Helpers::AssetTagHelper for more information.

Now anywhere in your SASS/SCSS, you can now use the asset-url() function.

// Compiles to: background-image: url('http://example.com/bg.png');
background-image: asset-url('bg.png');

Cool stuff.

Author

Sasset is written by Alexander Kern.

License

See the LICENSE file for details (it's the MIT License).

Something went wrong with that request. Please try again.