All Projects → codegram → sass-images

codegram / sass-images

Licence: MIT license
Sass extensions to deal with images

Programming Languages

ruby
36898 projects - #4 most used programming language

Sass::Images

Gem Version Build Status Dependency Status Coverage Status

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 image
  • image-height($path): Returns the height (px) of an image
  • inline-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')

Rails integration

sass-images is fully integrated with Rails and will find your asset pipeline's assets just like you would expect.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].