Sass::Images
Installation
Add this line to your application's Gemfile:
gem 'sass-images', github: 'codegram/sass-images'
And then execute:
$ bundle
Usage
This gem adds new sass helpers especially made to deal with image properties.
Right now it includes:
image-width($path)
: Returns the width (px) of an imageimage-height($path)
: Returns the height (px) of an imageinline-image($path)
: Returns an inlined Data URI scheme of an image
Example
h1.logo a
display: block
text-indent: -999em
overflow: hidden
width: image-width('logo.png')
height: image-height('logo.png')
background-image: inline-image('logo.png')
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request