-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
Copy pathsegment-button.ionic.scss
124 lines (98 loc) · 3.54 KB
/
segment-button.ionic.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
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./segment-button.common";
// Ionic Segment Button
// --------------------------------------------------
:host {
/**
* @prop --color-disabled: Color of the disabled segment button
*/
--background: none;
--background-checked: var(--background);
--color: #{globals.$ion-primitives-neutral-1000};
--color-checked: #{globals.$ion-semantics-primary-base};
--color-disabled: #{globals.$ion-primitives-neutral-500};
--border-width: #{globals.$ion-border-size-025};
--border-color: #{globals.$ion-primitives-neutral-300};
--border-style: #{globals.$ion-border-style-solid};
--indicator-box-shadow: none;
--indicator-color: var(--color-checked);
--indicator-height: #{globals.$ion-border-size-025};
--indicator-transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
--indicator-transform: none;
--padding-top: #{globals.$ion-space-200};
--padding-end: #{globals.$ion-space-200};
--padding-bottom: #{globals.$ion-space-200};
--padding-start: #{globals.$ion-space-200};
--transition: color 0.15s linear 0s, opacity 0.15s linear 0s;
min-width: globals.$ion-scale-1200;
min-height: globals.$ion-scale-1200;
}
.button-native {
border-bottom: var(--border-width) var(--border-style) var(--border-color);
// Ensures the indicator moves correctly between segment buttons
z-index: 1;
}
.button-inner {
@include globals.padding(globals.$ion-space-100, null, globals.$ion-space-100, null);
gap: globals.$ion-space-100;
}
// Segment Button Label/Text
// --------------------------------------------------
::slotted(ion-label),
::slotted(ion-text) {
@include globals.typography(globals.$ion-body-action-sm);
color: var(--color);
}
// Segment Button Icon
// --------------------------------------------------
::slotted(ion-icon) {
width: globals.$ion-scale-600;
height: globals.$ion-scale-600;
color: var(--color);
}
// Segment Button: Checked
// --------------------------------------------------
:host(.segment-button-checked) ::slotted(ion-label),
:host(.segment-button-checked) ::slotted(ion-text),
:host(.segment-button-checked) ::slotted(ion-icon) {
color: var(--color-checked);
}
// Segment Button: Disabled
// --------------------------------------------------
:host(.segment-button-disabled) ::slotted(ion-label),
:host(.segment-button-disabled) ::slotted(ion-text),
:host(.segment-button-disabled) ::slotted(ion-icon) {
color: var(--color-disabled);
}
// Segment Button: Focused
// --------------------------------------------------
:host(.ion-focused) .button-inner {
@include globals.focused-state();
}
// Segment Button: Indicator
// --------------------------------------------------
.segment-button-indicator {
@include globals.position(null, 0, 0, 0);
// Ensures the indicator displays correctly above the border
z-index: 2;
}
// Segment Button Layout
// --------------------------------------------------
// Segments with icons above or below the label
// should have a fixed height of 72px
:host(.segment-button-layout-icon-top),
:host(.segment-button-layout-icon-bottom) {
height: globals.$ion-scale-1800;
}
// Segments with icons at the start or end, or with only
// icons or labels, should have a fixed height of 48px
:host(.segment-button-has-label-only),
:host(.segment-button-has-icon-only),
:host(.segment-button-layout-icon-start),
:host(.segment-button-layout-icon-end) {
height: globals.$ion-scale-1200;
}
:host(.segment-button-layout-icon-start) .button-inner,
:host(.segment-button-layout-icon-end) .button-inner {
gap: globals.$ion-space-200;
}