Skip to content

An eyeglass module giving node-sass the same image dimension functionality found in ruby compass.

License

Notifications You must be signed in to change notification settings

jackw/eyeglass-image-dimensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status NPM Downloads devDependency Status

eyeglass-image-dimensions

An eyeglass module to give node-sass the same image dimension functionality found in ruby compass.

Setup

To use image dimensions first install eyeglass then eyeglass-image-dimensions:

npm install eyeglass eyeglass-image-dimensions --save-dev

Then add the following to your sass file/s:

@import 'image-dimensions';

Usage

image-width

returns the width of the image in pixels.

width: image-width($image);

image-height

returns the height of the image in pixels.

height: image-height($image);

image-dimensions

returns a space separated list consisting of the width and height of an image in pixels.

background-size: image-dimensions($image);