Skip to content

Commit e4b02e5

Browse files
committed
fix badge positioning
1 parent f7856a2 commit e4b02e5

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

core/src/components/tab-button/tab-button.ionic.scss

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -149,33 +149,20 @@
149149
@include globals.position(calc(50% + 14px));
150150
}
151151

152-
/*
153-
* When the icon has a top margin (icon-top layout with both icon and
154-
* label), shift the badges down by the same amount so they stay anchored
155-
* to the icon visually rather than to the tab-button's outer box.
156-
*/
157-
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge) {
158-
top: calc(globals.$ion-scale-100 * -1);
159-
}
160-
161-
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge:empty) {
162-
top: 0;
163-
}
164-
165152
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-top) {
166153
top: 2px;
167154
}
168155

169-
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-top:empty) {
170-
top: 0;
156+
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-bottom) {
157+
@include globals.position(calc(50% - globals.$ion-scale-150));
171158
}
172159

173-
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-bottom) {
174-
top: calc(50% - globals.$ion-space-100);
160+
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-top:empty) {
161+
top: 0;
175162
}
176163

177164
:host(.tab-layout-icon-top.tab-has-icon.tab-has-label) ::slotted(ion-badge.badge-vertical-bottom:empty) {
178-
top: 50%;
165+
@include globals.position(calc(50% - globals.$ion-scale-100/2));
179166
}
180167

181168
/*

0 commit comments

Comments
 (0)