bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/toast/styles.scss

263 lines
5.0 KiB
SCSS
Raw Normal View History

@import "../../stylesheets/variables/breakpoints";
2017-10-13 02:53:33 +08:00
:root {
--toast-default-color: var(--color-white);
--toast-default-bg: var(--color-gray);
2017-10-13 02:53:33 +08:00
--toast-info-color: var(--color-white);
--toast-info-bg: var(--color-primary);
2017-10-13 02:53:33 +08:00
--toast-success-color: var(--color-white);
--toast-success-bg: var(--color-success);
2017-10-13 02:53:33 +08:00
--toast-error-color: var(--color-white);
--toast-error-bg: var(--color-danger);
2017-10-13 02:53:33 +08:00
--toast-warning-color: var(--color-white);
--toast-warning-bg: var(--color-warning);
2017-10-13 02:53:33 +08:00
--background: var(--color-white);
--background-active: #eee;
--toast-offset: 4.5rem;
2019-04-04 23:29:46 +08:00
--toast-offset-sm: .325rem;
--toast-mobile-width: 75%;
2019-04-04 23:29:46 +08:00
--toast-max-width: 20rem !important;
--toast-body-max-width: 17.75rem !important;
--toast-container-max-width: 23rem !important;
--toast-container-min-width: var(--toast-max-width);
--toast-icon-md: 2rem;
--toast-icon-sm: 1.2rem;
}
2017-10-13 02:53:33 +08:00
@mixin notification-variant($icon-color, $icon-bg) {
display: flex;
> .icon {
color: $icon-color;
background-color: $icon-bg;
}
}
.toastContainer {
display: flex;
flex-direction: column;
}
.smallToastContainer {
background-color: inherit;
}
2017-10-13 02:53:33 +08:00
.icon {
align-self: flex-start;
margin: 0 var(--sm-padding-x) auto 0;
2019-04-04 23:29:46 +08:00
width: var(--toast-icon-md);
height: var(--toast-icon-md);
2017-10-13 02:53:33 +08:00
border-radius: 50%;
position: relative;
flex-shrink: 0;
[dir="rtl"] & {
margin: 0 0 auto var(--sm-padding-x);
}
2017-10-13 02:53:33 +08:00
> i {
line-height: 0;
color: inherit;
position: absolute;
top: 50%;
width: 100%;
}
}
.smallIcon {
2019-04-04 23:29:46 +08:00
width: var(--toast-icon-sm);
height: var(--toast-icon-sm);
> i {
font-size: 70%;
}
}
.separator {
2019-04-04 23:29:46 +08:00
position: relative;
width: 100%;
height: var(--border-size-small);
background-color: var(--color-gray-lighter);
margin-top: calc(var(--line-height-computed) * .5);
margin-bottom: calc(var(--line-height-computed) * .5);
}
2017-10-13 02:53:33 +08:00
.message {
margin-top: auto;
margin-bottom: auto;
font-size: var(--font-size-small);
2017-10-13 02:53:33 +08:00
max-height: 15vh;
overflow: auto;
}
.smallMessage {
font-size: 80%;
}
2017-10-13 02:53:33 +08:00
.default {
@include notification-variant(var(--toast-default-color), var(--toast-default-bg));
2017-10-13 02:53:33 +08:00
}
.info {
@include notification-variant(var(--toast-info-color), var(--toast-info-bg));
2017-10-13 02:53:33 +08:00
}
.success {
@include notification-variant(var(--toast-success-color), var(--toast-success-bg));
2017-10-13 02:53:33 +08:00
}
.error {
@include notification-variant(var(--toast-error-color), var(--toast-error-bg));
2017-10-13 02:53:33 +08:00
}
.warning {
@include notification-variant(var(--toast-warning-color), var(--toast-warning-bg));
2017-10-13 02:53:33 +08:00
}
.container {
z-index: 9998;
2017-10-13 02:53:33 +08:00
position: fixed;
padding: var(--sm-padding-y);
2019-04-04 23:29:46 +08:00
min-width: var(--toast-container-min-width);
max-width: var(--toast-container-max-width);
2017-10-13 02:53:33 +08:00
box-sizing: border-box;
right: var(--jumbo-padding-y);
left: auto;
top: var(--toast-offset);
2017-10-13 02:53:33 +08:00
max-height: 75vh;
overflow: hidden;
[dir="rtl"] & {
right: auto;
left: var(--jumbo-padding-y);
}
2017-10-13 02:53:33 +08:00
@include mq($small-only) {
width: var(--toast-mobile-width);
2017-10-13 02:53:33 +08:00
}
}
.toast ,
.actionToast {
2017-10-13 02:53:33 +08:00
position: relative;
margin-bottom: var(--sm-padding-x);
2020-08-10 21:10:13 +08:00
padding: var(--sm-padding-x);
border-radius: var(--border-radius);
2019-04-04 23:29:46 +08:00
box-shadow: 0 var(--border-size-small) 10px 0 rgba(0, 0, 0, 0.1), 0 var(--border-size) 15px 0 rgba(0, 0, 0, 0.05);
2017-10-13 02:53:33 +08:00
display: flex;
justify-content: space-between;
color: var(--color-text);
-webkit-animation-duration: 0.75s;
2017-10-13 02:53:33 +08:00
animation-duration: 0.75s;
-webkit-animation-fill-mode: both;
2017-10-13 02:53:33 +08:00
animation-fill-mode: both;
2019-04-04 23:29:46 +08:00
max-width: var(--toast-max-width);
min-width: var(--toast-max-width);
2020-02-11 02:19:49 +08:00
width: var(--toast-max-width);
}
.toast {
cursor: pointer;
background-color: var(--background);
2017-10-13 02:53:33 +08:00
&:hover,
&:focus {
background-color: var(--background-active);
2017-10-13 02:53:33 +08:00
}
}
.actionToast {
background-color: var(--color-white);
i.close {
left: none !important;
}
}
2017-10-13 02:53:33 +08:00
.body {
2019-04-04 23:29:46 +08:00
margin: auto auto;
2017-10-13 02:53:33 +08:00
flex: 1;
2018-07-06 20:05:56 +08:00
background-color: inherit;
2019-04-04 23:29:46 +08:00
max-width: var(--toast-body-max-width);
2017-10-13 02:53:33 +08:00
}
.close {
background: transparent;
outline: none;
border: none;
cursor: pointer;
opacity: .5;
2019-04-04 23:29:46 +08:00
font-size: var(--font-size-smallest);
color: var(--color-gray-dark);
2017-10-13 02:53:33 +08:00
line-height: 0;
2019-04-04 23:29:46 +08:00
position: relative;
font-size: 70%;
2019-04-04 23:29:46 +08:00
left: var(--toast-offset-sm);
[dir="rtl"] & {
left: auto;
right: var(--toast-offset-sm);
}
:global(.animationsEnabled) & {
transition: .3s ease;
}
2017-10-13 02:53:33 +08:00
&:before {
margin: inherit inherit inherit -.4rem;
[dir="rtl"] & {
margin: inherit -.4rem inherit inherit;
}
2017-10-13 02:53:33 +08:00
}
&:hover,
&:focus {
opacity: 1;
}
@include mq($small-only) {
position: relative;
2019-04-04 23:29:46 +08:00
font-size: var(--font-size-smaller);
left: auto;
2017-10-13 02:53:33 +08:00
}
}
@keyframes track-progress {
0% {
width: 100%;
}
100% {
width: 0;
}
}
.backgroundColorInherit {
2019-04-04 23:29:46 +08:00
position: relative;
2018-07-06 20:05:56 +08:00
}
2017-10-13 02:53:33 +08:00
.progress {
position: absolute;
bottom: 0;
left: 0;
right: auto;
2017-10-13 02:53:33 +08:00
width: 0;
height: 5px;
z-index: 9999;
animation: track-progress linear 1;
background-color: var(--color-gray-lighter);
border-radius: var(--border-radius);
[dir="rtl"] & {
left: auto;
right: 0;
}
2017-10-13 02:53:33 +08:00
}