https://github.com/jackw/eyeglass-image-dimensions
An eyeglass module giving node-sass the same image dimension functionality found in ruby compass.
https://github.com/jackw/eyeglass-image-dimensions
eyeglass eyeglass-image-dimensions image-dimensions images node-sass sass
Last synced: about 1 year ago
JSON representation
An eyeglass module giving node-sass the same image dimension functionality found in ruby compass.
- Host: GitHub
- URL: https://github.com/jackw/eyeglass-image-dimensions
- Owner: jackw
- License: apache-2.0
- Created: 2015-07-16T08:13:39.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:23:55.000Z (over 2 years ago)
- Last Synced: 2024-03-15T13:22:16.769Z (about 2 years ago)
- Topics: eyeglass, eyeglass-image-dimensions, image-dimensions, images, node-sass, sass
- Language: JavaScript
- Homepage:
- Size: 45.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/jackw/eyeglass-image-dimensions)
[](http://npm-stat.com/charts.html?package=eyeglass-image-dimensions&author=&from=&to=)
[](https://david-dm.org/jackw/eyeglass-image-dimensions#info=devDependencies)
# 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);
```