box-shadow-creator
v1.0.0
Published
Get perfect shadows every time for the no-designer this is perfect for a quick box shadow solution.
Downloads
4
Readme
What is Box Shadow Creator?
Get perfect shadows every time for the no-designer this is perfect for a quick box shadow solution.
Installation
npm i box-shadow-creator --save
Basic usage for JavaScript
function boxShadowCreator(options) {
let images = document.querySelectorAll('.box-shadow');
if (options.shadow_type === 'hard') {
options.shadow_type = '0px';
} else {
options.shadow_type = '15px';
}
images.forEach(image => {
image.style.boxShadow = `10px 10px ${options.shadow_type} 1px rgba(0,0,0,0.12)`;
if (options.padding) {
image.style.padding = '1em';
}
})
}
Basic usage for npm users
import { boxShadowCreator } from 'box-shadow-creator';
boxShadowCreator({
shadow_type: 'soft',
padding: false
})
All Options
Box shadow creator supports 2 options, both of which are optional:
- shadow_type - hard / soft (defaults to soft)
- padding - boolean (defaults to false)