Skip to content

Commit 29f0132

Browse files
committed
Display: Fix styles for primevue message
1 parent 88b9aa1 commit 29f0132

File tree

1 file changed

+107
-57
lines changed

1 file changed

+107
-57
lines changed

assets/css/scss/atoms/_messages.scss

Lines changed: 107 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,159 @@
11
.p-message {
2-
@apply mb-4 shadow-sm rounded-md border-0;
2+
@apply rounded-md outline-none outline-0;
33

4-
&-wrapper {
5-
@apply flex items-center; // gap-3.5;
6-
}
7-
8-
& &-wrapper {
9-
@apply py-3 px-4;
4+
&-content {
5+
@apply flex items-center gap-4 py-3 px-4 h-full;
106
}
117

128
&-icon {
13-
@apply shrink-0;
9+
@apply shrink-0 text-body-1 w-6 h-6;
1410
}
1511

16-
& &-icon {
17-
@apply text-body-1 mr-2;
12+
&-close-button {
13+
@apply flex items-center justify-center shrink-0 ms-auto overflow-hidden relative w-8 h-8 rounded-full bg-transparent transition outline-none cursor-pointer select-none;
1814

19-
&:not(.p-message-close-icon) {
20-
@apply w-6 h-6;
15+
&:focus-visible {
16+
@apply outline-none outline-0;
2117
}
18+
19+
.p-message-info & { }
20+
21+
.p-message-success & { }
22+
23+
.p-message-warn & { }
24+
25+
.p-message-error & { }
26+
27+
.p-message-secondary & { }
28+
29+
.p-message-contrast & { }
30+
}
31+
32+
&-close-icon {
33+
@apply text-body-2 w-6 h-6;
2234
}
2335

24-
&-close {
25-
@apply flex items-center justify-center shrink-0; // rounded-full transition duration-200 min-w-[1rem] min-h-[1rem];
36+
&-info {
37+
@apply bg-info text-white outline-none;
2638

27-
&.p-link {
28-
@apply ml-auto overflow-hidden relative;
29-
}
39+
&.p-message-outlined { }
40+
41+
&.p-message-simple { }
3042
}
3143

32-
& &-close {
33-
@apply w-8 h-8 rounded-full bg-transparent transition-none outline-transparent
34-
hover:bg-white/50
35-
focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:drop-shadow-lg;
44+
&-success {
45+
@apply bg-success text-white outline-none;
46+
47+
&.p-message-outlined { }
48+
49+
&.p-message-simple { }
50+
}
51+
52+
&-warn {
53+
@apply bg-warning text-gray-90 outline-none;
54+
55+
&.p-message-outlined { }
56+
57+
&.p-message-simple { }
58+
}
59+
60+
&-error {
61+
@apply bg-danger text-white outline-none;
62+
63+
&.p-message-outlined { }
64+
65+
&.p-message-simple { }
66+
}
67+
68+
&-secondary {
69+
@apply bg-secondary text-white outline-none;
70+
71+
&.p-message-outlined { }
72+
73+
&.p-message-simple { }
74+
}
75+
76+
&-contrast {
77+
@apply bg-gray-90 text-white outline-none;
78+
79+
&.p-message-outlined { }
80+
81+
&.p-message-simple { }
82+
}
83+
84+
&-text {
85+
@apply text-body-2 font-normal;
3686
}
3787

3888
&-enter-from {
3989
@apply opacity-0;
4090
}
4191

4292
&-enter-active {
43-
@apply transition-opacity duration-300;
93+
@apply transition-opacity duration-200;
4494
}
4595

4696
&.p-message-leave-from {
47-
@apply max-h-96;
97+
@apply max-h-[1000px];
4898
}
4999

50-
&.p-message-leave-to {
100+
&.p-message-leave-from {
51101
@apply max-h-0 opacity-0 m-0;
52102
}
53103

54104
&-leave-active {
55105
@apply overflow-hidden transition;
56-
}
57106

58-
&-leave-active &-close {
59-
@apply hidden;
107+
& .p-message-close-button {
108+
@apply opacity-0;
109+
}
60110
}
61111

62-
& &-text {
63-
@apply text-body-2 w-full;
64-
65-
a {
66-
@apply font-semibold;
112+
&-sm {
113+
& .p-message-content {
114+
@apply p-2;
67115
}
68-
}
69116

70-
.p-message-icon {
71-
@apply leading-normal;
72-
}
117+
& .p-message-text {
118+
@apply text-body-2;
119+
}
73120

74-
&.p-message-info {
75-
@apply bg-info text-white;
121+
& .p-message-icon {
122+
@apply text-body-1 w-4 h-4;
123+
}
76124

77-
.p-message-icon,
78-
.p-message-close {
79-
@apply text-white;
125+
&.p-message-close-icon {
126+
@apply text-body-2 w-4 h-4;
80127
}
81128
}
82129

83-
&.p-message-success {
84-
@apply bg-success text-white;
130+
&-lg {
131+
& .p-message-content {
132+
@apply p-6;
133+
}
85134

86-
.p-message-icon,
87-
.p-message-close {
88-
@apply text-white;
135+
& .p-message-text {
136+
@apply text-body-1;
89137
}
90-
}
91138

92-
&.p-message-warn {
93-
@apply bg-warning text-gray-90;
139+
& .p-message-icon {
140+
@apply text-h5 w-8 h-8;
141+
}
94142

95-
.p-message-icon,
96-
.p-message-close {
97-
@apply text-gray-90;
143+
&.p-message-close-icon {
144+
@apply text-body-2 w-6 h-6;
98145
}
99146
}
100147

101-
&.p-message-error {
102-
@apply bg-error text-white;
148+
&-message-outlined {
149+
@apply bg-transparent outline-none;
150+
}
151+
152+
&-simple {
153+
@apply bg-transparent outline-none;
103154

104-
.p-message-icon,
105-
.p-message-close {
106-
@apply text-white;
155+
& .p-message-content {
156+
@apply p-0;
107157
}
108158
}
109159
}

0 commit comments

Comments
 (0)