-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalert.scss
128 lines (111 loc) · 2.13 KB
/
alert.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@import 'common';
@import 'bootstrap/scss/alert';
.alert-icon {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: remsize(40);
height: 100%;
border-top-left-radius: remsize(3);
border-bottom-left-radius: remsize(3);
}
.alert {
display: flex;
padding: map-get($spacers, '8p') remsize(40);
> .close {
display: block;
position: absolute;
text-align: right;
padding-right: 8px;
width: 48px;
right: 0;
top: 0;
bottom: 0;
}
&.action {
box-shadow: map-get(map-get($shadows, 'md'), light);
padding-right: map-get($spacers, '8p');
> .alert-content {
margin-left: map-get($spacers, '8p');
margin-right: map-get($spacers, '12p');
}
@include darkTheme {
> .close > svg {
fill: $white;
}
}
}
&.bordered {
border-width: 1px;
@include darkTheme {
> .close > svg {
fill: $white;
}
}
}
&-lg {
padding: 18px 62px 18px 62px;
> .alert-icon {
width: 62px;
}
&.action {
> .alert-content {
margin-left: map-get($spacers, '16p');
}
}
}
&.spaced {
padding: map-get($spacers, '32p');
> .close {
height: 48px;
}
}
$alert-types: (
'info': (
'colors': $info-colors,
'bordered': $info-bordered,
'action': $info-action,
'spaced': $info-spaced,
),
'error': (
'colors': $error-colors,
'bordered': $error-bordered,
'action': $error-action,
'spaced': $error-spaced,
),
'warning': (
'colors': $warning-colors,
'bordered': $warning-bordered,
'action': $warning-action,
'spaced': $warning-spaced,
),
'success': (
'colors': $success-colors,
'bordered': $success-bordered,
'action': $success-action,
'spaced': $success-spaced,
),
);
@each $type, $map in $alert-types {
$colors: map-get($map, 'colors');
$bordered: map-get($map, 'bordered');
$action: map-get($map, 'action');
$spaced: map-get($map, 'spaced');
&.alert-#{$type} {
@include alert-type($colors...);
&.action {
@include alert-type($action...);
}
&.bordered {
@include alert-type($bordered...);
}
&.spaced {
@include alert-type($spaced...);
}
}
}
}