box-shadow
v1.0.0
Published
Create a CSS box shadow using JS objects
Downloads
11
Maintainers
Readme
box-shadow
Create a CSS box shadow using JS objects
Install
$ npm install --save box-shadow
Usage
var boxShadow = require('box-shadow')
boxShadow({
x: 0,
y: 2,
blur: 3,
spread: 4,
color: [204, 54, 51]
})
//=> 0px 2px 3px 4px rgba(204,54,51,1)
API
boxShadow(data)
-> string
data
Required
Type: object
/ array[object]
An object containing CSS properties for the box shadow:
- x
- y
- blur
- spread
These can be strings (1em
) or numbers to be converted to pixels (2
-> 2px
).
Additionally, data
requires a color
property to be passed to color-style. This can be a simple string (red
) or an array of RGBA values ([204, 54, 51, 0.5]
).
License
MIT © Ben Drucker