css-image-dimensions plugin for gulp
This plugin is meant as a drop-in replacement for the image-width and image-height functions from Compass.
gulp-css-image-dimensions as a development dependency:
npm install --save-dev gulp-css-image-dimensions
Then, add it to your
Note for usage in conjunction with CSS-Preprocessors If you are using this plugin in conjunction with a preprocessore like Sass, you should make sure to call this plugin after it.
var cssImageDimensions = ;gulp
In your CSS, you can now write the following:
assuming imagename.png is e.g. 25x30px, gulp-css-image-dimensions will turn this into
The path to your images directory. This can be either absolute, or relative to your css files.