-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathtab-button.ionic.scss
More file actions
154 lines (113 loc) · 4.25 KB
/
tab-button.ionic.scss
File metadata and controls
154 lines (113 loc) · 4.25 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
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./tab-button.common";
// Ionic Tab Button
// --------------------------------------------------------------
:host {
--focus-ring-color: #{globals.$ion-border-focus-default};
--focus-ring-width: #{globals.$ion-border-radius-025};
--padding-top: #{globals.$ion-space-100};
--padding-end: #{globals.$ion-space-400};
--padding-bottom: #{globals.$ion-space-100};
--padding-start: #{globals.$ion-space-400};
@include globals.typography(globals.$ion-body-action-xs);
position: relative;
align-content: center;
min-height: globals.$ion-scale-1200;
max-height: globals.$ion-scale-1800;
}
// Tab Button: Native
// --------------------------------------------------
.button-native {
@include globals.border-radius(inherit);
@include globals.margin(0);
@include globals.padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
@include globals.text-inherit();
overflow: visible;
}
.button-native::after {
@include globals.button-state();
}
// Tab Button Disabled
// -------------------------------------------------------------------------------
:host(.tab-disabled)::after {
@include globals.disabled-state();
z-index: 1;
}
// Tab Button Focused
// -------------------------------------------------------------------------------
.button-native {
min-width: globals.$ion-scale-1200;
min-height: globals.$ion-scale-1200;
overflow: visible;
&::after {
@include globals.border-radius(inherit);
}
}
// Only show the focus ring when the tab button is focused
:host(.ion-focused) .button-native {
&::after {
outline: var(--focus-ring-width) solid var(--focus-ring-color);
}
}
// Tab Button Activated
// -------------------------------------------------------------------------------
:host(.ion-activated) .button-native::after {
background: var(--background-activated);
opacity: var(--background-activated-opacity);
}
// Tab Button Slots
// -------------------------------------------------------------------------------
// Icon
::slotted(ion-icon) {
width: globals.$ion-scale-600;
height: globals.$ion-scale-600;
}
// Tab Button Shapes
// -------------------------------------------------------------------------------
:host(.tab-button-shape-soft) {
@include globals.border-radius(globals.$ion-border-radius-200);
}
:host(.tab-button-shape-round) {
@include globals.border-radius(globals.$ion-border-radius-400);
}
:host(.tab-button-shape-rectangular) {
@include globals.border-radius(globals.$ion-border-radius-0);
}
// Tab Button: Badge
// --------------------------------------------------
:host ::slotted(ion-badge) {
@include globals.position(null, null, null, calc(50% + globals.$ion-scale-300));
@include globals.transform(translate(-50%, -50%));
}
:host ::slotted(ion-badge.badge-vertical-top) {
@include globals.position(globals.$ion-scale-150);
}
:host ::slotted(ion-badge.badge-vertical-top:empty) {
@include globals.position(globals.$ion-scale-050, null, null, calc(50% + globals.$ion-scale-250));
}
:host(.tab-layout-icon-top) ::slotted(ion-badge.badge-vertical-bottom) {
@include globals.position(calc(50% - (globals.$ion-scale-050)));
}
:host(.tab-layout-icon-top) ::slotted(ion-badge.badge-vertical-bottom:empty) {
@include globals.position(50%, null, null, calc(50% + globals.$ion-scale-250));
}
:host ::slotted(ion-badge[vertical]:not(:empty)) {
@include globals.padding(globals.$ion-scale-100);
display: flex;
align-items: center;
justify-content: center;
}
:host(.tab-layout-icon-bottom) ::slotted(ion-badge.badge-vertical-top) {
@include globals.position(calc(50% + globals.$ion-scale-100));
}
:host(.tab-layout-icon-bottom) ::slotted(ion-badge.badge-vertical-top:empty) {
@include globals.position(50%);
}
:host(.tab-layout-icon-bottom) ::slotted(ion-badge.badge-vertical-bottom),
:host(.tab-layout-label-hide) ::slotted(ion-badge.badge-vertical-bottom) {
@include globals.position(calc(100% - globals.$ion-scale-100));
}
:host(.tab-layout-icon-bottom) ::slotted(ion-badge.badge-vertical-bottom:empty),
:host(.tab-layout-label-hide) ::slotted(ion-badge.badge-vertical-bottom:empty) {
@include globals.position(calc(100% - globals.$ion-scale-050), null, null, calc(50% + globals.$ion-scale-250));
}