codecheck
203 строки · 4.9 Кб
1// core
2.p-toast {
3width: 25rem;
4white-space: pre-line;
5word-break: break-word;
6}
7
8.p-toast-message-icon {
9flex-shrink: 0;
10}
11
12.p-toast-message-content {
13display: flex;
14align-items: flex-start;
15}
16
17.p-toast-message-text {
18flex: 1 1 auto;
19}
20
21.p-toast-top-center {
22transform: translateX(-50%);
23}
24
25.p-toast-bottom-center {
26transform: translateX(-50%);
27}
28
29.p-toast-center {
30min-width: 20vw;
31transform: translate(-50%, -50%);
32}
33
34.p-toast-icon-close {
35display: flex;
36align-items: center;
37justify-content: center;
38overflow: hidden;
39position: relative;
40}
41
42.p-toast-icon-close.p-link {
43cursor: pointer;
44}
45
46/* Animations */
47.p-toast-message-enter-from {
48opacity: 0;
49-webkit-transform: translateY(50%);
50-ms-transform: translateY(50%);
51transform: translateY(50%);
52}
53
54.p-toast-message-leave-from {
55max-height: 1000px;
56}
57
58.p-toast .p-toast-message.p-toast-message-leave-to {
59max-height: 0;
60opacity: 0;
61margin-bottom: 0;
62overflow: hidden;
63}
64
65.p-toast-message-enter-active {
66-webkit-transition: transform 0.3s, opacity 0.3s;
67transition: transform 0.3s, opacity 0.3s;
68}
69
70.p-toast-message-leave-active {
71-webkit-transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;
72transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;
73}
74
75// theme
76.p-toast {
77opacity: $toastOpacity;
78
79.p-toast-message {
80margin: $toastMargin;
81box-shadow: $toastShadow;
82border-radius: $borderRadius;
83
84.p-toast-message-content {
85padding: $toastPadding;
86border-width: $toastBorderWidth;
87
88.p-toast-message-text {
89margin: $toastMessageTextMargin;
90}
91
92.p-toast-message-icon {
93font-size: $toastIconFontSize;
94
95&.p-icon {
96width: $toastIconFontSize;
97height: $toastIconFontSize;
98}
99}
100
101.p-toast-summary {
102font-weight: $toastTitleFontWeight;
103}
104
105.p-toast-detail {
106margin: $toastDetailMargin;
107}
108}
109
110.p-toast-icon-close {
111width: $toastIconFontSize;
112height: $toastIconFontSize;
113border-radius: $actionIconBorderRadius;
114background: transparent;
115transition: $actionIconTransition;
116outline-color: transparent;
117
118&:hover {
119background: rgba(255, 255, 255, 0.5);
120}
121
122&:focus-visible {
123@include focused();
124}
125}
126
127&.p-toast-message-info {
128background: $infoMessageBg;
129border: $infoMessageBorder;
130border-width: $messageBorderWidth;
131color: $infoMessageTextColor;
132
133.p-toast-message-icon,
134.p-toast-icon-close {
135color: $infoMessageIconColor;
136}
137}
138
139&.p-toast-message-success {
140background: $successMessageBg;
141border: $successMessageBorder;
142border-width: $messageBorderWidth;
143color: $successMessageTextColor;
144
145.p-toast-message-icon,
146.p-toast-icon-close {
147color: $successMessageIconColor;
148}
149}
150
151&.p-toast-message-warn {
152background: $warningMessageBg;
153border: $warningMessageBorder;
154border-width: $messageBorderWidth;
155color: $warningMessageTextColor;
156
157.p-toast-message-icon,
158.p-toast-icon-close {
159color: $warningMessageIconColor;
160}
161}
162
163&.p-toast-message-error {
164background: $errorMessageBg;
165border: $errorMessageBorder;
166border-width: $messageBorderWidth;
167color: $errorMessageTextColor;
168
169.p-toast-message-icon,
170.p-toast-icon-close {
171color: $errorMessageIconColor;
172}
173}
174
175@if variable-exists(secondaryMessageBg) {
176&.p-toast-message-secondary {
177background: $secondaryMessageBg;
178border: $secondaryMessageBorder;
179border-width: $messageBorderWidth;
180color: $secondaryMessageTextColor;
181
182.p-toast-message-icon,
183.p-toast-icon-close {
184color: $secondaryMessageIconColor;
185}
186}
187}
188
189@if variable-exists(contrastMessageBg) {
190&.p-toast-message-contrast {
191background: $contrastMessageBg;
192border: $contrastMessageBorder;
193border-width: $messageBorderWidth;
194color: $contrastMessageTextColor;
195
196.p-toast-message-icon,
197.p-toast-icon-close {
198color: $contrastMessageIconColor;
199}
200}
201}
202}
203}
204