image-to-boxshadow

1.0.1 • Public • Published

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".

Package Sidebar

Install

npm i image-to-boxshadow

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

5.3 kB

Total Files

4

Last publish

Collaborators

  • aske_kjoller