UNPKG

funda-ui

Version:

React components using pure Bootstrap 5+ which does not contain any external style and script libraries.

150 lines (148 loc) 3.71 kB
/* ====================================================== <!-- Toast --> /* ====================================================== */ .toasts__wrapper { --bs-toast-zindex: 1090; --bs-border-radius: 0.375rem; --toasts-offset-top: 35px; --toasts-offset-bottom: 15px; --toasts-offset-bothsides: 15px; --toasts-container-gap: 0.5rem; --toasts-container-width: 350px; --toasts-progress-height: 3px; --toasts-progress-bg: rgba(228, 228, 228, 0.6); width: var(--toasts-container-width); position: fixed; left: 50%; bottom: 0; z-index: var(--bs-toast-zindex); pointer-events: none; transition: 0.1s ease-in-out; /* cascading divs */ /* progress */ } .toasts__wrapper--bottom-left { left: var(--toasts-offset-bothsides); } .toasts__wrapper--bottom-right { left: auto; right: var(--toasts-offset-bothsides); } .toasts__wrapper--bottom-center { left: 50%; transform: translateX(-50%); } .toasts__wrapper--top-left { left: var(--toasts-offset-bothsides); bottom: auto; top: var(--toasts-offset-top); } .toasts__wrapper--top-right { left: auto; right: var(--toasts-offset-bothsides); top: var(--toasts-offset-top); } .toasts__wrapper--top-center { left: 50%; transform: translateX(-50%); top: var(--toasts-offset-top); } .toasts__wrapper--vertical-center { left: 50%; transform: translate(-50%, -50%); top: 50%; margin-top: 5%; } .toasts__wrapper .toasts { position: relative; width: 100%; bottom: var(--toasts-offset-bottom); display: flex; flex-flow: column-reverse nowrap; } .toasts__wrapper .toasts::before { content: ""; top: -80px; bottom: 0; left: -8px; right: -8px; position: absolute; background-color: transparent; pointer-events: none; } .toasts__wrapper .toast-container { margin-bottom: var(--toasts-container-gap); /* Use clip-path instead of opacity to achieve a fade effect, avoiding the problem of transparency overlay */ clip-path: inset(0 0 0 0); transform: translateY(0); /* Rendering of 3D transformations */ backface-visibility: hidden; transform-style: preserve-3d; /* init animation */ /* enter animation */ /* exit animation */ } .toasts__wrapper .toast-container.animate-ready { pointer-events: none; clip-path: inset(0 0 100% 0); transform: translateY(10px); } .toasts__wrapper .toast-container.animate-in { clip-path: inset(0 0 0 0); transform: translateY(0); } .toasts__wrapper .toast-container.hide-start { clip-path: inset(0 0 100% 0); transform: translateY(-10px); } .toasts__wrapper.toasts__wrapper--cascading .toast-container { margin-bottom: 0; } .toasts__wrapper.toasts__wrapper--cascading .toasts:hover .toast-container { transform: perspective(100px) translateZ(0) !important; } .toasts__wrapper .toast-progress { position: absolute; width: 100%; bottom: 0px; left: 0px; height: var(--toasts-progress-height); background: transparent; border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius); overflow: hidden; } .toasts__wrapper .toast-progress .progress-bar { background: var(--toasts-progress-bg); width: 100%; height: 100%; transition: all 0.1s; } /* Bootstrap toast here */ .toast-container { width: 100%; height: auto; position: relative; transition: all 0.25s; pointer-events: auto; } .toast-container [data-close] { background: none; } .toast-container [data-close]:focus { box-shadow: none; } .toast-container [data-close] svg { vertical-align: top; } .toast-container [data-close] svg path { transition: 0.3s ease-in-out; } .toast-container [data-close]:hover svg path { fill: #f00; } .toast-container.hide-start { opacity: 0; } .toast-container.hide-end { display: none; }