1.1.1 • Published 2 years ago
shadow-overlay v1.1.1
Shadow Overlay
GZipped: 1.6Kb
ES Module module.js
5.99KB
CommonJS index.js
6.63KB
Installation
npm i -D shadow-overlay
pnpm i -D shadow-overlay
yarn add -D shadow-overlay
Most basic usage
// index.ts
import 'shadow-overlay'
Markup mode
Element Attributes list
attribute | type |
---|---|
opacity | number |
color | Any css valid color unit |
margin | Any css size unit |
gutters | Any css size unit |
width | Any css size unit |
disabled | https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled |
controller | Similar to disabled, controller='true' or just controller will work |
HTML example
You can use the custom element by using import the main.js file in your <head>
The attribute type
should be module
<!DOCTYPE html>
<html>
<head>
<script
type="module"
src="./node_modules/shadow-overlay/dist/module.js"
></script>
</head>
<body>
<grid-overlay /> --> custom element 🎉
</body>
</html>
The custom attribute list above contains all attributes that can be passed to the overlay
<grid-overlay color="red" /> --> I'm a red grid now! ⭕⭕⭕⭕
Scripting mode
Methods
attribute | type |
---|---|
start | undefined |
setOpacity | number between 0 and 1 |
setColor | any css color |
setMargin | Any css size unit |
setGutters | Any css size unit |
setWidth | Any css size unit |
setController | boolean |
Basic usage
Import the overlay and start the instance
import { overlay } from 'shadow-overlay'
overlay.start()
Methods usage
Start
overlay.start()
Opacity
overlay.setOpacity(0.4)
Color
overlay.setColor('red')
overlay.setColor('ff0000')
overlay.setColor('hsl(0, 100%, 50%)')
overlay.setColor('rgb(255, 0, 0)')
Margin, Gutters
overlay.setMargin('16px')
overlay.setMargin('1em')
overlay.setMargin('1rem')
overlay.setMargin('5ch')
overlay.setMargin('5%')
Width
be careful not to use values that are too small or you risk not being able to see the grid
overlay.setWidth('920px')
overlay.setWidth('50rem')
overlay.setWidth('90ch')
overlay.setWidth('90%')
Controller
overlay.setController(true)
1.1.1
2 years ago
1.0.1
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.0
2 years ago