forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.ios.scss
More file actions
321 lines (219 loc) · 9.22 KB
/
button.ios.scss
File metadata and controls
321 lines (219 loc) · 9.22 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
@import "../../themes/ionic.globals.ios";
// iOS Button
// --------------------------------------------------
/// @prop - Margin of the button
$button-ios-margin: .4rem .2rem !default;
/// @prop - Padding of the button
$button-ios-padding: 0 1em !default;
/// @prop - Height of the button
$button-ios-height: 2.8em !default;
/// @prop - Border radius of the button
$button-ios-border-radius: 4px !default;
/// @prop - Font size of the button text
$button-ios-font-size: 1.6rem !default;
/// @prop - Background color of the button
$button-ios-background-color: color($colors-ios, primary) !default;
/// @prop - Text color of the button
$button-ios-text-color: color-contrast($colors-ios, $button-ios-background-color) !default;
/// @prop - Background color of the activated button
$button-ios-background-color-activated: color-shade($button-ios-background-color) !default;
/// @prop - Opacity of the activated button
$button-ios-opacity-activated: 1 !default;
/// @prop - Opacity of the button on hover
$button-ios-opacity-hover: .8 !default;
// iOS Large Button
// --------------------------------------------------
/// @prop - Padding of the large button
$button-ios-large-padding: 0 1em !default;
/// @prop - Height of the large button
$button-ios-large-height: 2.8em !default;
/// @prop - Font size of the large button
$button-ios-large-font-size: 2rem !default;
// iOS Small Button
// --------------------------------------------------
/// @prop - Padding of the small button
$button-ios-small-padding: 0 .9em !default;
/// @prop - Height of the small button
$button-ios-small-height: 2.1em !default;
/// @prop - Font size of the small button
$button-ios-small-font-size: 1.3rem !default;
/// @prop - Font size of an icon in the small button
$button-ios-small-icon-font-size: 1.3em !default;
// iOS Outline Button
// --------------------------------------------------
/// @prop - Border width of the outline button
$button-ios-outline-border-width: 1px !default;
/// @prop - Border style of the outline button
$button-ios-outline-border-style: solid !default;
/// @prop - Border radius of the outline button
$button-ios-outline-border-radius: $button-ios-border-radius !default;
/// @prop - Border color of the outline button
$button-ios-outline-border-color: $button-ios-background-color !default;
/// @prop - Text color of the outline button
$button-ios-outline-text-color: $button-ios-background-color !default;
/// @prop - Background color of the outline button
$button-ios-outline-background-color: transparent !default;
/// @prop - Text color of the activated outline button
$button-ios-outline-text-color-activated: color-contrast($colors-ios, $button-ios-background-color) !default;
/// @prop - Background color of the activated outline button
$button-ios-outline-background-color-activated: $button-ios-background-color !default;
/// @prop - Opacity of the activated outline button
$button-ios-outline-opacity-activated: 1 !default;
// iOS Clear Button
// --------------------------------------------------
/// @prop - Border color of the clear button
$button-ios-clear-border-color: transparent !default;
/// @prop - Background color of the clear button
$button-ios-clear-background-color: transparent !default;
/// @prop - Background color of the activated clear button
$button-ios-clear-background-color-activated: $button-ios-clear-background-color !default;
/// @prop - Opacity of the activated clear button
$button-ios-clear-opacity-activated: .4 !default;
/// @prop - Text color of the clear button on hover
$button-ios-clear-text-color-hover: $button-ios-background-color !default;
/// @prop - Opacity of the clear button on hover
$button-ios-clear-opacity-hover: .6 !default;
// iOS Round Button
// --------------------------------------------------
/// @prop - Padding of the round button
$button-ios-round-padding: $button-round-padding !default;
/// @prop - Border radius of the round button
$button-ios-round-border-radius: $button-round-border-radius !default;
// iOS FAB Button
// --------------------------------------------------
/// @prop - Border radius of the FAB button
$button-ios-fab-border-radius: 50% !default;
// iOS Default Button
// --------------------------------------------------
.button-ios {
margin: $button-ios-margin;
padding: $button-ios-padding;
height: $button-ios-height;
border-radius: $button-ios-border-radius;
font-size: $button-ios-font-size;
color: $button-ios-text-color;
background-color: $button-ios-background-color;
}
.button-ios.activated {
background-color: $button-ios-background-color-activated;
opacity: $button-ios-opacity-activated;
}
.button-ios:hover:not(.disable-hover) {
opacity: $button-ios-opacity-hover;
}
// iOS Default Button Color Mixin
// --------------------------------------------------
@mixin ios-button-default($color-name, $color-base, $color-contrast) {
$background-color: $color-base;
$background-color-activated: color-shade($background-color);
$fg-color: $color-contrast;
.button-ios-#{$color-name} {
color: $fg-color;
background-color: $background-color;
}
.button-ios-#{$color-name}.activated {
background-color: $background-color-activated;
}
}
// iOS Button Sizes
// --------------------------------------------------
.button-large-ios {
padding: $button-ios-large-padding;
height: $button-ios-large-height;
font-size: $button-ios-large-font-size;
}
.button-small-ios {
padding: $button-ios-small-padding;
height: $button-ios-small-height;
font-size: $button-ios-small-font-size;
}
.button-small-ios[icon-only] ion-icon {
font-size: $button-ios-small-icon-font-size;
}
// iOS Block Button
// --------------------------------------------------
.button-block-ios {
margin-right: 0;
margin-left: 0;
}
// iOS Full Button
// --------------------------------------------------
.button-full-ios {
margin-right: 0;
margin-left: 0;
border-right-width: 0;
border-left-width: 0;
border-radius: 0;
}
// iOS Outline Button
// --------------------------------------------------
.button-outline-ios {
border-width: $button-ios-outline-border-width;
border-style: $button-ios-outline-border-style;
border-radius: $button-ios-outline-border-radius;
border-color: $button-ios-outline-border-color;
color: $button-ios-outline-text-color;
background-color: $button-ios-outline-background-color;
}
.button-outline-ios.activated {
color: $button-ios-outline-text-color-activated;
background-color: $button-ios-outline-background-color-activated;
opacity: $button-ios-outline-opacity-activated;
}
// iOS Outline Button Color Mixin
// --------------------------------------------------
@mixin ios-button-outline($color-name, $color-base, $color-contrast) {
.button-outline-ios-#{$color-name} {
border-color: $color-base;
color: $color-base;
background-color: $button-ios-outline-background-color;
}
.button-outline-ios-#{$color-name}.activated {
color: $color-contrast;
background-color: $color-base;
}
}
// iOS Clear Button
// --------------------------------------------------
.button-clear-ios {
border-color: $button-ios-clear-border-color;
color: $button-ios-background-color;
background-color: $button-ios-clear-background-color;
}
.button-clear-ios.activated {
background-color: $button-ios-clear-background-color-activated;
opacity: $button-ios-clear-opacity-activated;
}
.button-clear-ios:hover:not(.disable-hover) {
color: $button-ios-clear-text-color-hover;
opacity: $button-ios-clear-opacity-hover;
}
// iOS Clear Button Color Mixin
// --------------------------------------------------
@mixin ios-button-clear($color-name, $color-base, $color-contrast) {
$fg-color: $color-base;
.button-clear-ios-#{$color-name} {
border-color: $button-ios-clear-border-color;
color: $fg-color;
background-color: $button-ios-clear-background-color;
}
.button-clear-ios-#{$color-name}.activated {
opacity: $button-ios-clear-opacity-activated;
}
.button-clear-ios-#{$color-name}:hover:not(.disable-hover) {
color: $fg-color;
}
}
// iOS Round Button
// --------------------------------------------------
.button-round-ios {
padding: $button-ios-round-padding;
border-radius: $button-ios-round-border-radius;
}
// Generate iOS Button Colors
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-ios) {
@include ios-button-default($color-name, $color-base, $color-contrast);
@include ios-button-outline($color-name, $color-base, $color-contrast);
@include ios-button-clear($color-name, $color-base, $color-contrast);
}