Here is a tiny patch that adds Bourbon's stylesheets path to Sass.load_paths for non Rails apps to be able to use the stylesheets from the gem, instead of copying and updating them manually into each project.
Adding stylesheets path to Sass.load_paths
Adding the stylesheets path to Sass' load_paths allows non Rails
apps to use the assets bundled with the gem directly, instead of
copying them manually into each projects, and manually updating
@ysbaddaden, I'm just getting around to testing this (oops, it should have been done before pushing a new version). Have you had success in getting this working in a non-rails app? I can't seem to get it to pull from the gem using @import 'bourbon' or @import 'bourbon/bourbon', after removing the bourbon directory from a project.
Do you have any insight?
@plapier of course, I should have given some examples before.
Here is an example using Sass::Plugin::Rack, which is what this pull request meant to simplify: https://gist.github.com/ysbaddaden/4750870
You may also use the command line, using a Gemfile then running something like:
bundle exec sass -r 'bourbon' --watch assets/stylesheets:public/stylesheets
It's a bit complicated for everyday use, but useful for building static assets in a cap deploy.
@plapier I believe this makes the non-Rails installation directions in the README obsolete.
Silly me. I skipped the fact that we have Sprockets set up in the Sinatra app I was incorporating Bourbon. It didn't occur to me that without an asset pipeline, the instructions still hold.
@hakanensari, no. If I understand correctly, this doesn't makes the non-rails installation obsolete. I think they have different uses.
This feature is great for tying the bourbon gem into other non-rails web apps, like Sinatra.
Otherwise, generating bourbon files into your static project is helpful for maintaining the correct bourbon version over time.
Cheers @ysbaddaden! Nice work and thanks a ton!
For those who are looking for a solution to setting Bourbon and Neat up with Sprockets and the sinatra-asset-pipeline gem, I made a small repo example here: https://github.com/runemadsen/sinatra-asset-pipeline-bourbon-neat
Thank you @runemadsen! I added your repo to the Sinatra wiki page. Feel free to edit or add any details you wish. https://github.com/thoughtbot/bourbon/wiki/Sinatra
Awesome! I spent so long trying to manually paste in the bourbon folder, trying different @import statements, but realized that it can load the assets directly from the gem if you know how to set it up.