main
css 101 lines 1.65 KB
Raw
1 #toast {
2 position: relative;
3 width: 100%;
4 background-color: #333;
5 font-family: "Rubik", Arial, Helvetica, sans-serif;
6 color: #fff;
7 padding: 0.6rem 0.9rem;
8 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
9 display: none;
10 align-items: center;
11 z-index: 1000;
12 transform: translateY(100%);
13 transition: transform 0.4s cubic-bezier(0.19, 0.86, 0.47, 1), background-color 0.3s ease;
14 will-change: transform;
15 }
16
17 .toast__content {
18 display: flex;
19 flex-direction: column;
20 flex-grow: 1;
21 margin-left: var(--spacing-xs);
22 margin-right: 16px;
23 }
24
25 .toast__title {
26 font-size: 0.6rem;
27 color: #fff;
28 opacity: 0.7;
29 margin-bottom: 0.3rem;
30 }
31
32 .toast__separator {
33 height: 1px;
34 background: rgba(255, 255, 255, 0.15);
35 margin-bottom: 0.3rem;
36 }
37
38 .toast__message {
39 margin: 0;
40 /* max-width: 320px; */
41 text-overflow: ellipsis !important;
42 }
43
44 #toast.show {
45 display: flex;
46 transform: translateY(0);
47 }
48
49 #toast.hide {
50 transform: translateY(100%);
51 }
52
53 #toast.toast--success {
54 background-color: #4CAF50;
55 }
56
57 #toast.toast--error {
58 background-color: #731811;
59 }
60
61 #toast.toast--info {
62 background-color: #2196F3;
63 }
64
65 .toast__close,
66 .toast__copy {
67 background-color: transparent;
68 border: none;
69 font-family: "Rubik", Arial, Helvetica, sans-serif;
70 color: #fff;
71 cursor: pointer;
72 font-size: 16px;
73 margin-left: 8px;
74 opacity: 0.8;
75 transition: opacity 0.2s ease;
76 }
77
78 .toast__close:hover,
79 .toast__copy:hover {
80 opacity: 1;
81 }
82
83 /* Animations */
84
85 @keyframes toastIn {
86 from {
87 transform: translateY(100%);
88 }
89 to {
90 transform: translateY(0);
91 }
92 }
93
94 @keyframes toastOut {
95 from {
96 transform: translateY(0);
97 }
98 to {
99 transform: translateY(100%);
100 }
101 }