-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Expand file tree
/
Copy pathtab-button.ionic.scss
More file actions
159 lines (115 loc) · 4.31 KB
/
Copy pathtab-button.ionic.scss
File metadata and controls
159 lines (115 loc) · 4.31 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
@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};
position: relative;
align-content: center;
min-width: globals.$ion-scale-1200;
min-height: globals.$ion-scale-1200;
max-height: globals.$ion-scale-1800;
// Add styles from typography mixin but exclude line-height.
// line-height causes inconsistent rendering in Firefox (FW-7566).
font-family: map-get(globals.$ion-body-action-xs, font-family);
font-size: map-get(globals.$ion-body-action-xs, font-size);
font-weight: map-get(globals.$ion-body-action-xs, font-weight);
letter-spacing: map-get(globals.$ion-body-action-xs, letter-spacing);
text-decoration: map-get(globals.$ion-body-action-xs, text-decoration);
text-transform: map-get(globals.$ion-body-action-xs, text-transform);
}
// 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;
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(calc(globals.$ion-scale-100 * -2), null, null, calc(50% + globals.$ion-scale-300));
transform: translateX(-50%);
}
// Status badge (empty) needs less offset to overlap the icon
:host ::slotted(ion-badge:empty) {
@include globals.position(calc(globals.$ion-scale-100 * -1), null, null, calc(50% + globals.$ion-scale-250));
}
:host ::slotted(ion-badge.badge-vertical-top) {
@include globals.position(-2px);
}
:host ::slotted(ion-badge.badge-vertical-top:empty) {
@include globals.position(calc(globals.$ion-scale-100 * -1));
}
:host ::slotted(ion-badge.badge-vertical-bottom) {
@include globals.position(calc(50% - globals.$ion-scale-200));
}
:host ::slotted(ion-badge.badge-vertical-bottom:empty) {
@include globals.position(calc(50% - globals.$ion-scale-100));
}
: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-bottom) {
@include globals.position(calc(50% + globals.$ion-scale-100));
}
:host(.tab-layout-icon-bottom) ::slotted(ion-badge.badge-vertical-bottom:empty) {
@include globals.position(calc(50% + 14px));
}