diff --git a/packages/core/src/components/toast/_toast.scss b/packages/core/src/components/toast/_toast.scss index c14ce53bed..7f47c3827a 100644 --- a/packages/core/src/components/toast/_toast.scss +++ b/packages/core/src/components/toast/_toast.scss @@ -147,6 +147,10 @@ $toast-margin: $pt-grid-size * 2 !default; } .pt-toast-container { + display: flex; + flex-direction: column; + align-items: center; + position: fixed; right: 0; left: 0; @@ -155,20 +159,15 @@ $toast-margin: $pt-grid-size * 2 !default; z-index: $pt-z-index-overlay * 2; // toasts have margin-top so omit it on container + // prevent container from scrolling as new toasts enter (from bottom) + overflow: hidden; + + // ensure there's enough space for full box-shadow + padding: 0 $toast-margin $toast-margin; + // container will not block clicks on elements behind it pointer-events: none; - // TransitionGroup - > div { - display: flex; - flex-direction: column; - align-items: center; - // prevent container from scrolling as new toasts enter (from bottom) - overflow: hidden; - // ensure there's enough space for full box-shadow - padding: 0 $toast-margin $toast-margin; - } - &.pt-toast-container-top { top: 0; // clear opposite side cuz .pt-overlay has all sides 0'ed @@ -176,19 +175,16 @@ $toast-margin: $pt-grid-size * 2 !default; } &.pt-toast-container-bottom { + flex-direction: column-reverse; top: auto; bottom: 0; - - > div { - flex-direction: column-reverse; - } } - &.pt-toast-container-left > div { + &.pt-toast-container-left { align-items: flex-start; } - &.pt-toast-container-right > div { + &.pt-toast-container-right { align-items: flex-end; } }