Skip to content

Instantly share code, notes, and snippets.

@nhunzaker
Created November 2, 2011 20:35
Show Gist options
  • Save nhunzaker/1334829 to your computer and use it in GitHub Desktop.
Save nhunzaker/1334829 to your computer and use it in GitHub Desktop.
Compass with Sprites on Rails 3.1
# Note:
# Place this file within the config directory of your Rails 3.1 Application
##########################################################################################
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "app/assets/stylesheets"
sass_dir = "app/assets/stylesheets"
images_dir = "app/assets/images"
javascripts_dir = "app/assets/javascripts"
output_style = :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass public/sass scss && rm -rf sass && mv scss sass
preferred_syntax = :scss
// The location of the images to compile
@import "icons/*.png";
// Automagically creates classes for each sprite image
@include all-icons-sprites;
// Make a sprite!
span.tools {
@include icons-sprite(tools);
}
@anand180
Copy link

anand180 commented Nov 3, 2011

Thanks!

@nhunzaker
Copy link
Author

No problem! It feels good to save someone else the angst!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment