-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathalert.md.scss
More file actions
347 lines (259 loc) · 8.16 KB
/
alert.md.scss
File metadata and controls
347 lines (259 loc) · 8.16 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@import "./alert.native";
@import "./alert.md.vars";
// Material Design Alert
// --------------------------------------------------
:host {
--background: #{$alert-md-background-color};
--max-width: #{$alert-md-max-width};
--backdrop-opacity: var(--ion-backdrop-opacity, 0.32);
font-size: $alert-md-font-size;
}
.alert-wrapper {
@include border-radius($alert-md-border-radius);
box-shadow: $alert-md-box-shadow;
}
// Material Design Alert Header
// --------------------------------------------------
.alert-head {
@include padding(
$alert-md-head-padding-top,
$alert-md-head-padding-end,
$alert-md-head-padding-bottom,
$alert-md-head-padding-start
);
text-align: $alert-md-head-text-align;
}
.alert-title {
color: $alert-md-title-color;
font-size: $alert-md-title-font-size;
font-weight: $alert-md-title-font-weight;
}
.alert-sub-title {
color: $alert-md-sub-title-text-color;
font-size: $alert-md-sub-title-font-size;
}
// Material Design Alert Message
// --------------------------------------------------
.alert-message,
.alert-input-group {
@include padding(
$alert-md-message-padding-top,
$alert-md-message-padding-end,
$alert-md-message-padding-bottom,
$alert-md-message-padding-start
);
color: $alert-md-message-text-color;
}
.alert-message {
font-size: $alert-md-message-font-size;
}
/**
* MD Alerts on tablets can expand vertically up to
* a total maximum height. We only want to set a max-height
* on mobile phones.
*/
@include mobile-viewport() {
.alert-message {
max-height: $alert-md-content-max-height;
}
}
.alert-message:empty {
@include padding(
$alert-md-message-empty-padding-top,
$alert-md-message-empty-padding-end,
$alert-md-message-empty-padding-bottom,
$alert-md-message-empty-padding-start
);
}
.alert-head + .alert-message {
padding-top: 0;
}
// Material Design Alert Input
// --------------------------------------------------
.alert-input {
@include margin(
$alert-md-input-margin-top,
$alert-md-input-margin-end,
$alert-md-input-margin-bottom,
$alert-md-input-margin-start
);
border-bottom: $alert-md-input-border-width $alert-md-input-border-style $alert-md-input-border-color;
color: $alert-md-input-text-color;
&::placeholder {
color: $alert-md-input-placeholder-color;
font-family: inherit;
font-weight: inherit;
}
&::-ms-clear {
display: none;
}
}
.alert-input:focus {
@include margin(null, null, $alert-md-input-margin-bottom - 1, null);
border-bottom: $alert-md-input-border-width-focused $alert-md-input-border-style-focused
$alert-md-input-border-color-focused;
}
// Material Design Alert Radio/Checkbox Group
// --------------------------------------------------
.alert-radio-group,
.alert-checkbox-group {
position: relative;
border-top: $alert-md-list-border-top;
border-bottom: $alert-md-list-border-bottom;
overflow: auto;
}
/**
* MD Alerts on tablets can expand vertically up to
* a total maximum height. We only want to set a max-height
* on mobile phones.
*/
@include mobile-viewport() {
.alert-radio-group,
.alert-checkbox-group {
max-height: $alert-md-content-max-height;
}
}
.alert-tappable {
position: relative;
min-height: $alert-md-tappable-height;
}
// Material Design Alert Radio
// --------------------------------------------------
.alert-radio-label {
@include padding(
$alert-md-radio-label-padding-top,
$alert-md-radio-label-padding-end,
$alert-md-radio-label-padding-bottom,
$alert-md-radio-label-padding-start
);
flex: 1;
color: $alert-md-radio-label-text-color;
font-size: $alert-md-radio-label-font-size;
}
// Material Design Alert Radio Unchecked Circle
// ---------------------------------------------------
.alert-radio-icon {
@include position($alert-md-radio-top, null, null, $alert-md-radio-left);
@include border-radius($alert-md-radio-border-radius);
display: block;
position: relative;
width: $alert-md-radio-width;
height: $alert-md-radio-height;
border-width: $alert-md-radio-border-width;
border-style: $alert-md-radio-border-style;
border-color: $alert-md-radio-border-color-off;
}
// Material Design Alert Radio Checked Dot
// ---------------------------------------------------
.alert-radio-inner {
@include position($alert-md-radio-icon-top, null, null, $alert-md-radio-icon-start);
@include border-radius($alert-md-radio-icon-border-radius);
position: absolute;
width: $alert-md-radio-icon-width;
height: $alert-md-radio-icon-height;
transform: $alert-md-radio-icon-transform-off;
transition: $alert-md-radio-icon-transition;
background-color: $alert-md-radio-border-color-on;
}
// Material Design Alert Radio Checked
// ---------------------------------------------------
[aria-checked="true"] .alert-radio-label {
color: $alert-md-radio-label-text-color-checked;
}
[aria-checked="true"] .alert-radio-icon {
border-color: $alert-md-radio-border-color-on;
}
[aria-checked="true"] .alert-radio-inner {
transform: $alert-md-radio-icon-transform-on;
}
// Material Design Alert Checkbox Label
// --------------------------------------------------
.alert-checkbox-label {
@include padding(
$alert-md-checkbox-label-padding-top,
$alert-md-checkbox-label-padding-end,
$alert-md-checkbox-label-padding-bottom,
$alert-md-checkbox-label-padding-start
);
flex: 1;
// Required for the checkbox icon to stay on the screen without
// being squished when the font size scales up.
width: calc(100% - $alert-md-checkbox-label-padding-start);
color: $alert-md-checkbox-label-text-color;
font-size: $alert-md-checkbox-label-font-size;
}
// Material Design Alert Checkbox Outline: Unchecked
// --------------------------------------------------
.alert-checkbox-icon {
@include position($alert-md-checkbox-top, null, null, $alert-md-checkbox-left);
@include border-radius($alert-md-checkbox-border-radius);
position: relative;
width: $alert-md-checkbox-width;
height: $alert-md-checkbox-height;
border-width: $alert-md-checkbox-border-width;
border-style: $alert-md-checkbox-border-style;
border-color: $alert-md-checkbox-border-color-off;
contain: strict;
}
// Material Design Alert Checkbox Checkmark: Checked
// --------------------------------------------------
[aria-checked="true"] .alert-checkbox-icon {
border-color: $alert-md-checkbox-border-color-on;
background-color: $alert-md-checkbox-border-color-on;
}
[aria-checked="true"] .alert-checkbox-inner {
@include position($alert-md-checkbox-icon-top, null, null, $alert-md-checkbox-icon-start);
position: absolute;
width: $alert-md-checkbox-icon-width;
height: $alert-md-checkbox-icon-height;
transform: $alert-md-checkbox-icon-transform;
border-width: $alert-md-checkbox-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-md-checkbox-icon-border-style;
border-color: $alert-md-checkbox-icon-border-color;
}
// Material Design Alert Button
// --------------------------------------------------
.alert-button-group {
@include padding(8px);
box-sizing: border-box;
flex-wrap: $alert-md-button-group-flex-wrap;
justify-content: $alert-md-button-group-justify-content;
}
.alert-button {
@include border-radius($alert-md-button-border-radius);
@include margin(
$alert-md-button-margin-top,
$alert-md-button-margin-end,
$alert-md-button-margin-bottom,
$alert-md-button-margin-start
);
@include padding(
$alert-md-button-padding-top,
$alert-md-button-padding-end,
$alert-md-button-padding-bottom,
$alert-md-button-padding-start
);
// necessary for ripple to work properly
position: relative;
background-color: $alert-md-button-background-color;
color: $alert-md-button-text-color;
font-weight: $alert-md-button-font-weight;
text-align: $alert-md-button-text-align;
text-transform: $alert-md-button-text-transform;
overflow: hidden;
}
.alert-button-inner {
justify-content: $alert-md-button-group-justify-content;
}
/**
* MD alerts should scale up to 560px x 560px
* on tablet dimensions.
*/
@include tablet-viewport() {
:host {
--max-width: #{$alert-md-max-width-tablet};
--max-height: #{$alert-md-max-height-tablet};
}
}