Skip to content

Commit 9292044

Browse files
- define padding space for ionic tab-button;
- guarantee hover and focus occupies the height; - when has a status-badge the top position should be always the same; - add example with tab-buttons without label;
1 parent 8361fd2 commit 9292044

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

core/src/components/badge/test/hint/index.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,38 @@
366366
</div>
367367
</ion-list>
368368

369+
<ion-list id="tab-button-icon-bottom">
370+
<ion-list-header>
371+
<ion-label> Inside Tab Button - Only Icon </ion-label>
372+
</ion-list-header>
373+
374+
<div class="ion-display-flex ion-align-items-center ion-justify-content-around ion-margin">
375+
<ion-tab-bar>
376+
<ion-tab-button href="" tab="tab-one" layout="label-hide">
377+
<ion-icon name="home"></ion-icon>
378+
<ion-badge size="small" vertical="top" color="danger"></ion-badge>
379+
</ion-tab-button>
380+
381+
<ion-tab-button tab="schedule" class="e2eTabTwoButton" layout="label-hide">
382+
<ion-icon name="globe"></ion-icon>
383+
<ion-badge size="small" vertical="top" color="primary">
384+
<ion-icon name="star"></ion-icon>
385+
</ion-badge>
386+
</ion-tab-button>
387+
388+
<ion-tab-button tab="tab-three" layout="label-hide">
389+
<ion-icon name="logo-facebook"></ion-icon>
390+
<ion-badge size="small" vertical="top" color="warning">999</ion-badge>
391+
</ion-tab-button>
392+
393+
<ion-tab-button tab="tab-four" class="e2eTabFourButton" layout="label-hide">
394+
<ion-icon name="chatbox"></ion-icon>
395+
<ion-badge vertical="top" color="success" size="small"></ion-badge>
396+
</ion-tab-button>
397+
</ion-tab-bar>
398+
</div>
399+
</ion-list>
400+
369401
<ion-list id="button-top">
370402
<ion-list-header>
371403
<ion-label> Inside Button - Top Placement </ion-label>

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
:host {
88
--focus-ring-color: #{globals.$ion-border-focus-default};
99
--focus-ring-width: #{globals.$ion-border-radius-025};
10+
--padding-top: #{globals.$ion-space-100};
11+
--padding-end: #{globals.$ion-space-400};
12+
--padding-bottom: #{globals.$ion-space-100};
13+
--padding-start: #{globals.$ion-space-400};
14+
1015

1116
@include globals.typography(globals.$ion-body-action-xs);
1217

@@ -48,6 +53,7 @@
4853

4954
.button-native {
5055
min-width: globals.$ion-scale-1200;
56+
min-height: globals.$ion-scale-1200;
5157

5258
overflow: visible;
5359

@@ -108,10 +114,6 @@
108114
@include globals.position(-2px);
109115
}
110116

111-
:host ::slotted(ion-badge.badge-vertical-top:empty) {
112-
@include globals.position(calc(globals.$ion-scale-100 * -1));
113-
}
114-
115117
:host ::slotted(ion-badge.badge-vertical-bottom) {
116118
@include globals.position(calc(50% - globals.$ion-scale-200));
117119
}

0 commit comments

Comments
 (0)