svelte-scrim
Version:
A vanilla JS scrim (backdrop) component made with Svelte.
41 lines (33 loc) • 526 B
HTML
<div
class="svelte-scrim"
style="
opacity: {{ opacity }};
background: {{ background }};
"
></div>
<script>
const DEFAULTS = {
opacity: 0.3,
background: '#000000'
}
Object.freeze(DEFAULTS)
export default {
tag: 'svelte-scrim',
setup (Scrim) {
Scrim.DEFAULTS = DEFAULTS
},
data () {
return Object.assign({}, DEFAULTS)
}
}
</script>
<style>
.svelte-scrim {
position: fixed;
top: 0;
right: 0;
left: 0;
height: 100vh;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
</style>