Project

sasset

0.0
No commit activity in last 3 years
No release in over 3 years
Allows multiple asset hosts to be used with SASS/SCSS
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

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).