Skip to content

Commit

Permalink
Merge d77d7bb into 52cb3ad
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Nov 14, 2019
2 parents 52cb3ad + d77d7bb commit 45ff5a4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/scss/_body.scss
Expand Up @@ -13,6 +13,10 @@

&.swal2-no-backdrop {
.swal2-container {
&::before {
background: transparent;
}

top: auto;
right: auto;
bottom: auto;
Expand Down
22 changes: 19 additions & 3 deletions src/scss/_core.scss
@@ -1,4 +1,17 @@
.swal2-container {
&::before {
content: '';
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
transition: $swal2-backdrop-transition;
opacity: 0;
background: $swal2-backdrop;
will-change: opacity;
}

// centering
display: flex;
position: fixed;
Expand All @@ -12,17 +25,20 @@
justify-content: center;
padding: $swal2-container-padding;
overflow-x: hidden;
transition: $swal2-backdrop-transition;

// sweetalert2/issues/905
-webkit-overflow-scrolling: touch;

&.swal2-backdrop-show {
background: $swal2-backdrop;
&::before {
opacity: 1;
}
}

&.swal2-backdrop-hide {
background: transparent !important;
&::before {
opacity: 0;
}
}

&.swal2-top {
Expand Down
4 changes: 3 additions & 1 deletion src/scss/_toasts-body.scss
@@ -1,7 +1,9 @@
@mixin sweetalert2-toasts-body() {
&.swal2-toast-shown {
.swal2-container {
background-color: transparent;
&::before {
background: transparent;
}

&.swal2-top {
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/variables.scss
Expand Up @@ -25,7 +25,7 @@ $swal2-font-size: 1rem !default;

// BACKDROP
$swal2-backdrop: rgba($swal2-black, .4) !default;
$swal2-backdrop-transition: background-color .1s !default;
$swal2-backdrop-transition: opacity .1s !default;

// ICONS
$swal2-icon-size: 5em !default;
Expand Down

0 comments on commit 45ff5a4

Please sign in to comment.