Christine McClure

The home for my shortcuts, code snippets, and oft-forgotten directions

www.christinemcclure.com

Compass

Ruby gem for process SCSS files into CSS

Configuration

These instructions are for non-Ruby projects where you have to configure Sass manually.

  1. Install compass gem, if necessary
  2. CD to project directory
  3. touch config.rb
  4. Edit file as below, or change to match your file structure (comments are what's generated with the compass create <projectName> command)
  5. # Require any additional compass plugins here.
    
    # Set this to the root of your project when deployed:
    http_path = "/"
    css_dir = "css"
    sass_dir = "sass"
    images_dir = "images"
    javascripts_dir = "javascripts"
    
    # You can select your preferred output style here (can be overridden via the command line):
    # output_style = :expanded or :nested or :compact or :compressed
    
    # To enable relative paths to assets via compass helper functions. Uncomment:
    # relative_assets = true
    
    # To disable debugging comments that display the original location of your selectors. Uncomment:
    # 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 sass scss && rm -rf sass && mv scss sass
    

When you need to compress for production:

  1. Create production branch
  2. compass compile --output-style compressed --force <directory name>
                                                                        -ad  ?check this later
    
  3. Verify that compresses CSS files were created
  4. Merge into master (Sass uses a different directory, so no worry about losing formatting)

Favorite color scheme and image sites