Skip to content

Instantly share code, notes, and snippets.

@fantactuka
Created February 22, 2012 20:43
Show Gist options
  • Save fantactuka/1887133 to your computer and use it in GitHub Desktop.
Save fantactuka/1887133 to your computer and use it in GitHub Desktop.
Compile sass file into string with compass includes
require "sass"
require "compass"
def compile_sass(sass_file)
sass_dir = File.dirname(sass_file)
compass_dir = File.join(Compass.base_directory, "frameworks/compass/stylesheets")
Sass.compile(File.read(sass_file), syntax: :sass, load_paths: [sass_dir, compass_dir])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment