Skip to content

Instantly share code, notes, and snippets.

@cancer
Created October 29, 2013 03:12
Show Gist options
  • Save cancer/7208670 to your computer and use it in GitHub Desktop.
Save cancer/7208670 to your computer and use it in GitHub Desktop.
Compassのsprite-mapでハマった ref: http://qiita.com/cancer/items/4c0d8f577c71e4b8667e
$sprite-map: sprite-map("sprite/*.png");
%sprite-base{
$sprite-path: sprite-path($sprite-map);
$sprite-width: image-width("sprite/"#{$sprite-path}) / 2;
$sprite-height: image-height("sprite/"#{$sprite-path}) / 2;
background-image: sprite-url($sprite-map);
background-size: $sprite-width $sprite-height;
background-repeat: no-repeat;
}
Errno::ENOENT on line 28 of /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/functions/image_size.rb: No such file or directory - ...
$sprite-map: sprite-map("sprite/*.png");
%sprite-base{
background: $sprite-map;
$sprite-path: sprite-path($sprite-map);
$sprite-width: image-width("sprite/"#{$sprite-path}) / 2;
$sprite-height: image-height("sprite/"#{$sprite-path}) / 2;
background-size: $sprite-width $sprite-height;
$sprite-map: sprite-map("sprite/*.png");
$sprite-url: sprite-url($sprite-map);
%sprite-base{
$sprite-path: sprite-path($sprite-map);
$sprite-width: image-width("sprite/"#{$sprite-path}) / 2;
$sprite-height: image-height("sprite/"#{$sprite-path}) / 2;
background-image: $sprite-url;
background-size: $sprite-width $sprite-height;
background-repeat: no-repeat;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment