-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathalert.ios.scss
More file actions
362 lines (270 loc) · 8.67 KB
/
alert.ios.scss
File metadata and controls
362 lines (270 loc) · 8.67 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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
@import "./alert.native";
@import "./alert.ios.vars";
// iOS Alert
// --------------------------------------------------
:host {
--background: #{$alert-ios-background-color};
--max-width: #{$alert-ios-max-width};
--backdrop-opacity: var(--ion-backdrop-opacity, 0.3);
font-size: $alert-ios-font-size;
}
.alert-wrapper {
@include border-radius($alert-ios-border-radius);
box-shadow: $alert-ios-box-shadow;
overflow: hidden;
}
.alert-button .alert-button-inner {
pointer-events: none;
}
// iOS Translucent Alert
// -----------------------------------------
@supports (backdrop-filter: blur(0)) {
:host(.alert-translucent) .alert-wrapper {
background: $alert-ios-translucent-background-color;
backdrop-filter: $alert-ios-translucent-filter;
}
}
// iOS Alert Header
// --------------------------------------------------
.alert-head {
@include padding(
$alert-ios-head-padding-top,
$alert-ios-head-padding-end,
$alert-ios-head-padding-bottom,
$alert-ios-head-padding-start
);
text-align: $alert-ios-head-text-align;
}
.alert-title {
@include margin($alert-ios-title-margin-top, null, null, null);
color: $alert-ios-title-color;
font-size: $alert-ios-title-font-size;
font-weight: $alert-ios-title-font-weight;
}
.alert-sub-title {
color: $alert-ios-sub-title-text-color;
font-size: $alert-ios-sub-title-font-size;
}
// iOS Alert Message
// --------------------------------------------------
.alert-message,
.alert-input-group {
@include padding(
$alert-ios-message-padding-top,
$alert-ios-message-padding-end,
$alert-ios-message-padding-bottom,
$alert-ios-message-padding-start
);
color: $alert-ios-message-text-color;
font-size: $alert-ios-message-font-size;
text-align: $alert-ios-message-text-align;
}
.alert-message {
max-height: $alert-ios-content-max-height;
}
.alert-message:empty {
@include padding(
$alert-ios-message-empty-padding-top,
$alert-ios-message-empty-padding-end,
$alert-ios-message-empty-padding-bottom,
$alert-ios-message-empty-padding-start
);
}
// iOS Alert Input
// --------------------------------------------------
.alert-input {
@include border-radius($alert-ios-input-border-radius);
@include margin($alert-ios-input-margin-top, null, null, null);
@include padding(
$alert-ios-input-padding-top,
$alert-ios-input-padding-end,
$alert-ios-input-padding-bottom,
$alert-ios-input-padding-start
);
border: $alert-ios-input-border;
background-color: $alert-ios-input-background-color;
appearance: none;
font-size: dynamic-font(16px);
&::placeholder {
color: $alert-ios-input-placeholder-color;
font-family: inherit;
font-weight: inherit;
}
&::-ms-clear {
display: none;
}
&::-webkit-date-and-time-value {
/**
* The -webkit-date-and-time-value pseudo element is used
* to style the date/time input on iOS/Mobile Safari.
* To avoid layout shift between an empty state and a selected state,
* we set the height `18px` to match the native input height for
* date/time inputs on iOS/Mobile Safari.
*/
height: 18px;
}
}
// iOS Alert Radio/Checkbox Group
// --------------------------------------------------
.alert-radio-group,
.alert-checkbox-group {
overscroll-behavior: contain;
max-height: $alert-ios-content-max-height;
border-top: $alert-ios-list-border-top;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.alert-tappable {
min-height: $alert-ios-tappable-height;
}
// iOS Alert Radio Label
// --------------------------------------------------
.alert-radio-label {
@include padding(
$alert-ios-radio-label-padding-top,
$alert-ios-radio-label-padding-end,
$alert-ios-radio-label-padding-bottom,
$alert-ios-radio-label-padding-start
);
flex: 1;
order: 0;
color: $alert-ios-radio-label-text-color;
}
// iOS Alert Radio Label: Checked
// --------------------------------------------------
[aria-checked="true"] .alert-radio-label {
color: $alert-ios-radio-label-text-color-checked;
}
// iOS Alert Radio Checkmark: Unchecked
// -----------------------------------------
.alert-radio-icon {
position: relative;
order: 1;
min-width: $alert-ios-radio-min-width;
}
// iOS Alert Radio Checked
// -----------------------------------------
[aria-checked="true"] .alert-radio-inner {
@include position($alert-ios-radio-icon-top, null, null, $alert-ios-radio-icon-start);
position: absolute;
width: $alert-ios-radio-icon-width;
height: $alert-ios-radio-icon-height;
transform: $alert-ios-radio-icon-transform;
border-width: $alert-ios-radio-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-ios-radio-icon-border-style;
border-color: $alert-ios-radio-icon-border-color;
}
// iOS Alert Checkbox Label
// --------------------------------------------------
.alert-checkbox-label {
@include padding(
$alert-ios-checkbox-label-padding-top,
$alert-ios-checkbox-label-padding-end,
$alert-ios-checkbox-label-padding-bottom,
$alert-ios-checkbox-label-padding-start
);
flex: 1;
color: $alert-ios-checkbox-label-text-color;
}
// iOS Alert Checkbox Outer Circle: Unchecked
// -----------------------------------------
.alert-checkbox-icon {
@include border-radius($alert-ios-checkbox-border-radius);
@include margin(
$alert-ios-checkbox-margin-top,
$alert-ios-checkbox-margin-end,
$alert-ios-checkbox-margin-bottom,
$alert-ios-checkbox-margin-start
);
position: relative;
width: $alert-ios-checkbox-size;
height: $alert-ios-checkbox-size;
border-width: $alert-ios-checkbox-border-width;
border-style: $alert-ios-checkbox-border-style;
border-color: $alert-ios-checkbox-border-color-off;
background-color: $alert-ios-checkbox-background-color-off;
contain: strict;
}
// iOS Alert Checkbox Outer Circle: Checked
// -----------------------------------------
[aria-checked="true"] .alert-checkbox-icon {
border-color: $alert-ios-checkbox-border-color-on;
background-color: $alert-ios-checkbox-background-color-on;
}
// iOS Alert Checkbox Inner Checkmark: Checked
// -----------------------------------------
[aria-checked="true"] .alert-checkbox-inner {
@include position($alert-ios-checkbox-icon-top, null, null, $alert-ios-checkbox-icon-start);
position: absolute;
width: $alert-ios-checkbox-icon-width;
height: $alert-ios-checkbox-icon-height;
transform: $alert-ios-checkbox-icon-transform;
border-width: $alert-ios-checkbox-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-ios-checkbox-icon-border-style;
border-color: $alert-ios-checkbox-icon-border-color;
}
// iOS Alert Button
// --------------------------------------------------
.alert-button-group {
@include margin-horizontal(null, -$alert-ios-button-border-width);
flex-wrap: $alert-ios-button-group-flex-wrap;
}
/**
* The right border should only be applied to the first button
* when the group has 2 or less buttons (horizontal).
* Otherwise, the right border should not be applied
* when the group has 3 or more buttons (vertical).
*/
.alert-button-group-vertical .alert-button {
border-right: none;
&:last-child {
@include rtl() {
border-right: none;
}
}
}
.alert-button {
/**
* This padding ensures that alerts
* with multiple buttons render on separate lines
* so the text does not run up against the edge of the button.
*/
@include padding-horizontal($alert-ios-button-padding);
@include margin($alert-ios-button-margin);
@include border-radius($alert-ios-button-border-radius);
flex: $alert-ios-button-flex;
min-width: $alert-ios-button-min-width;
height: $alert-ios-button-height;
border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
border-right: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
background-color: $alert-ios-button-background-color;
color: $alert-ios-button-text-color;
font-size: $alert-ios-button-font-size;
overflow: hidden;
}
.alert-button:first-child {
@include rtl() {
border-right: 0;
}
}
.alert-button:last-child {
@include rtl() {
border-right: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
}
border-right: 0;
font-weight: $alert-ios-button-main-font-weight;
}
.alert-button.ion-activated {
background-color: $alert-ios-button-background-color-activated;
}
// iOS Action Sheet Button: Destructive
// ---------------------------------------------------
.alert-button-role-destructive,
.alert-button-role-destructive.ion-activated,
.alert-button-role-destructive.ion-focused {
color: $alert-ios-button-destructive-text-color;
}