Anyone familiar with Compass to help solve a problem with sprites loading. The markup in the compile CSS points to the wrong address for the loading of the sprites.
Here is the generated CSS
/* ===================================================== */
/* Sprites
/* ===================================================== */
.spr-sprite, header h1 {
background-image: url('/images/spr-sf52e1e883c.png');
background-repeat: no-repeat;
}
.pitch-sprite, .pitch.left div, .pitch.middle div, .pitch.right div {
background-image: url('/images/pitch-s4b17d3ee2e.png');
background-repeat: no-repeat;
}
This is what works and what I am trying for where you back up one directory with '../'.
spr-sprite, header h1 {
background-image: url('../images/spr-sf52e1e883c.png');
background-repeat: no-repeat;
}
All of my research points to using the configuration parameter “relative_assests = true”, to resolve this but I can’t seem to convince my compass project to give me relative directories “../” for my sprite images. I compile my sprites with this configuration file.
.pitch-sprite, .pitch.left div, .pitch.middle div, .pitch.right div {
background-image: url('../images/pitch-s4b17d3ee2e.png');
background-repeat: no-repeat;
}
All of my research points to using the configuration parameter “relative_assests = true”, to resolve this but I can’t seem to convince my compass project to give me relative directories “../” for my sprite images. I compile my sprites with this configuration file.
# Require any additional compass plugins here.
# -----------------------------------------------------------------------------
project_path = File.expand_path("..",File.dirname(__FILE__))
# Set this to the root of your project when deployed:
# -----------------------------------------------------------------------------
relative_assets = true
http_images_dir = "images"
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "js"
# Output style and comments
# -----------------------------------------------------------------------------
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# Over-ride with force compile to change output style with: compass compile --output-style compressed --force
output_style = :expanded
#environment = :development
line_comments = false
cache = true
color_output = false # required for Mixture
require 'sass-globbing'
# Obviously
preferred_syntax = :scss
# SASS core
# -----------------------------------------------------------------------------
# Chrome needs a precision of 7 to round properly
Sass::Script::Number.precision = 7
I wonder if anyone sees a problem?