rework-imagesize / 0.1.2 last updated 2 years ago created on Dec 9th 2013

Install

npm install --save rework-imagesize

Clone

git clone git@github.com:simme/rework-imagesize.git

dependencies

main imagesize 1.0.0 BSD 4-Clause
rework-visit 1.0.0 MIT

maintainers

simme

versions

0.1.2 2 years ago simme
0.1.0 3 years ago simme
0 Downloads yesterday.

readme

Rework Imagesize

Uses the Imagesize module to read an image's size and put that size in your CSS!

Usage

1
2
3
4
5
6
var rework = require('rework');
var size   = require('rework-imagesize');

var css = rework(str)
  .use(size('path/to/images/folder'))
  .toString();

Using the above JavaScript. This:

1
2
3
4
5
h1 {
  background: url('myimage.png');
  imgsize: myimage.png;
  text-indent: 100%;
}

Would produce something like:

1
2
3
4
5
6
h1 {
  background: url('myimage.png');
  text-indent: 100%;
  height: 201px;
  width: 300px;
}

You can also use the "properties" imgsizew and imgsizeh to get only the width or height of the image, respectively.

License

MIT

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.