Skip to content

Commit

Permalink
Fix modal backdrop
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
  • Loading branch information
marcoambrosini committed Nov 27, 2019
1 parent 52f3f78 commit 0cd2258
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/Modal/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export default {
</docs>
<template>
<transition name="fade">
<div ref="mask" class="modal-mask" @click="handleMouseMove"
<div ref="mask"
class="modal-mask"
:class="{ 'modal-mask--dark' : dark }"
@click="handleMouseMove"
@mousemove="handleMouseMove" @touchmove="handleMouseMove">
<!-- Header -->
<transition name="fade-visibility">
Expand Down Expand Up @@ -256,6 +259,11 @@ export default {
canClose: {
type: Boolean,
default: true
},
/** Makes the modal backdrop black if true */
dark: {
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -459,7 +467,10 @@ $header-size: 50px;
display: block;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .92);
background-color: rgba(0, 0, 0, .5);
&--dark {
background-color: black;
}
}
.modal-header {
Expand Down Expand Up @@ -643,7 +654,7 @@ $header-size: 50px;
transition: transform 300ms ease;
border-radius: var(--border-radius-large);
background-color: var(--color-main-background);
box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
box-shadow: 0 0 40px rgba(0, 0, 0, .2);
}
&:not(&--large):not(&--full) .modal-container {
max-width: 900px;
Expand Down

0 comments on commit 0cd2258

Please sign in to comment.