Skip to content

Instantly share code, notes, and snippets.

@hmans
Created June 26, 2012 14:22
Show Gist options
  • Save hmans/2996065 to your computer and use it in GitHub Desktop.
Save hmans/2996065 to your computer and use it in GitHub Desktop.
How to use Compass outside Rails or Sinatra (eg., in pure Rack apps or frameworks like Happy)
# Require the compass gem. No need to do this if you're already requiring all your
# gems through Bundle.require.
#
require 'compass'
# This adds the stylesheets directory of the "compass" engine to Sass' default load path. The
# only other engine in Compass at the time of writing is "blueprint", which, as far as I
# know, is already tagged as deprecated.
#
Sass::Engine::DEFAULT_OPTIONS[:load_paths] << Compass::Frameworks["compass"].stylesheets_directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment