1+ /* Base Alert Styles */
2+ .alert {
3+ display : flex;
4+ align-items : start;
5+ padding : var (--space-4 );
6+ border-radius : var (--radius-lg );
7+ box-shadow : var (--shadow-md );
8+ font-size : 0.875rem ;
9+ position : relative;
10+ transition : var (--transition-all );
11+ background-color : var (--neutral-50 );
12+ color : var (--neutral-900 );
13+ }
14+
15+ /* Icon */
16+ .alert-icon {
17+ margin-right : var (--space-3 );
18+ font-size : 1.5rem ;
19+ flex-shrink : 0 ;
20+ color : inherit; /* Inherit color from alert variant */
21+ }
22+
23+ /* Content and Title */
24+ .alert-content {
25+ flex : 1 ;
26+ }
27+
28+ .alert-title {
29+ font-weight : 600 ;
30+ font-size : 1rem ;
31+ margin-bottom : 0.25rem ;
32+ }
33+
34+ .alert-body {
35+ margin-top : 0.5rem ;
36+ line-height : 1.4 ;
37+ }
38+
39+ .alert-footer {
40+ font-size : 0.75rem ;
41+ color : var (--neutral-500 );
42+ margin-top : var (--space-3 );
43+ }
44+
45+ /* Close Button */
46+ .alert-close {
47+ position : absolute;
48+ top : var (--space-2 );
49+ right : var (--space-2 );
50+ background : none;
51+ border : none;
52+ font-size : 1.25rem ;
53+ cursor : pointer;
54+ color : var (--neutral-500 );
55+ transition : color 0.2s ;
56+ }
57+
58+ .alert-close : hover {
59+ color : var (--neutral-700 );
60+ }
61+
62+ /* Auto Icons (can replace with SVG icons if needed) */
63+ .alert-success .alert-icon ::before { content : "✔" ; color : var (--success ); }
64+ .alert-warning .alert-icon ::before { content : "⚠" ; color : var (--warning ); }
65+ .alert-danger .alert-icon ::before { content : "✖" ; color : var (--danger ); }
66+ .alert-info .alert-icon ::before { content : "ℹ" ; color : var (--info ); }
67+
68+ /* Alert Variants */
69+ .alert-success {
70+ background : linear-gradient (135deg , rgba (16 , 185 , 129 , 0.15 ), rgba (16 , 185 , 129 , 0.05 ));
71+ color : var (--success );
72+ }
73+
74+ .alert-warning {
75+ background : linear-gradient (135deg , rgba (245 , 158 , 11 , 0.15 ), rgba (245 , 158 , 11 , 0.05 ));
76+ color : var (--warning );
77+ }
78+
79+ .alert-danger {
80+ background : linear-gradient (135deg , rgba (239 , 68 , 68 , 0.15 ), rgba (239 , 68 , 68 , 0.05 ));
81+ color : var (--danger );
82+ }
83+
84+ .alert-info {
85+ background : linear-gradient (135deg , rgba (59 , 130 , 246 , 0.15 ), rgba (59 , 130 , 246 , 0.05 ));
86+ color : var (--info );
87+ }
88+
89+ /* Outline Variants */
90+ .alert-outline {
91+ background-color : transparent;
92+ border : 1px solid currentColor;
93+ }
94+
95+ .alert-outline .alert-success { color : var (--success ); }
96+ .alert-outline .alert-warning { color : var (--warning ); }
97+ .alert-outline .alert-danger { color : var (--danger ); }
98+ .alert-outline .alert-info { color : var (--info ); }
99+
100+ /* Ghost Variants */
101+ .alert-ghost {
102+ background-color : transparent;
103+ color : var (--neutral-500 );
104+ box-shadow : none;
105+ }
106+
107+ /* Dismissible Alert with Animation */
108+ .alert-dismissible {
109+ padding-right : var (--space-10 );
110+ }
111+
112+ .alert-dismissible .alert-close {
113+ position : absolute;
114+ top : 0.75rem ;
115+ right : 0.75rem ;
116+ color : inherit;
117+ }
118+
119+ .alert-dismissible .alert-close : hover {
120+ color : var (--neutral-700 );
121+ }
122+
123+ .alert-dismissible .fade-out {
124+ opacity : 0 ;
125+ transform : translateY (-10px );
126+ transition : opacity 0.4s , transform 0.4s ;
127+ }
128+
129+ /* Compact Alert (Only Icon and Title) */
130+ .alert-compact {
131+ flex-direction : row;
132+ align-items : center;
133+ }
134+
135+ .alert-compact .alert-icon {
136+ font-size : 1.25rem ;
137+ }
138+
139+ .alert-compact .alert-title {
140+ margin : 0 ;
141+ font-weight : 500 ;
142+ }
143+
144+ /* Large Alert */
145+ .alert-lg {
146+ padding : var (--space-6 );
147+ font-size : 1rem ;
148+ }
149+
150+ .alert-lg .alert-icon {
151+ font-size : 2rem ;
152+ }
153+
154+ /* Responsive Adjustments */
155+ @media (max-width : 600px ) {
156+ .alert {
157+ flex-direction : column;
158+ align-items : flex-start;
159+ }
160+
161+ .alert-icon {
162+ margin-bottom : var (--space-3 );
163+ }
164+
165+ .alert-dismissible {
166+ padding-right : var (--space-4 );
167+ }
168+ }
0 commit comments