1.0.1 • Published 3 years ago

image-to-boxshadow v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Image to box shadows.

Turns images (jpeg, png, whatever..) into pure css using box-shadows - because... Why not?. The result can either be returned as a string, or saved directly to a file.

GitHub NPM

Installing

To install, simply run the command below.

npm install image-to-boxshadow

Using

This package contains one function: imageToBoxShadow. So start by importing this.

const { imageToBoxShadow } = require ('image-to-boxshadow');

The function takes three parameters: image_path, element_name and result_path.

image_path - The path to the image, that is going to be converted. element_name - The class name of the element which the styling will be applied to - can be left blank for 'element'. result_path - The path to the file in which the result will be saved - if left blank, it will simply return the string.

Using this you can simply call the function like this:

imageToBoxShadow ('./monalisa.jpeg', 'element', './monalisa.css')

This will take the image, on the path "./monalisa.jpeg", and save it the file "./monalisa.css", with the css selector pointing to ".element".