This gem adds retina background-image mixins to Compass.
Add this line to your application's Gemfile:
gem 'compass-retina'
Or, for the bleeding edge version:
gem 'compass-retina', :github => 'midnox/compass-retina', :branch => :master
And then execute:
$ bundle
Or install it yourself as:
$ gem install compass-retina
In your SASS/SCSS stylesheet:
@import "compass-retina";
.foo {
@include background-image-retina("image.png");
}
Put the two image files into your compass project's images_dir
:
image.png
image@2x.png
The mixin will gracefully check the availability of a 2x file and only then add related media queries to the generated css.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request