Skip to content

Commit c4eed02

Browse files
author
Adam Bradley
committed
fix(badge): Update badge alignment in tab items, closes #694
1 parent 7cead03 commit c4eed02

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

scss/_tabs.scss

+5-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
@include flex(1);
9090
display: block;
9191
overflow: hidden;
92-
92+
9393
max-width: $tab-item-max-width;
9494
height: 100%;
9595

@@ -157,8 +157,9 @@
157157
.tab-item .badge {
158158
position: absolute;
159159
padding: $tabs-badge-padding;
160-
top: 2%;
161-
right: 10%;
160+
top: 4%;
161+
right: 33%; // fallback
162+
right: calc(50% - 26px);
162163
font-size: $tabs-badge-font-size;
163164
height: auto;
164165
line-height: $tabs-badge-font-size + 4;
@@ -167,7 +168,7 @@
167168
/* Navigational tab */
168169

169170
/* Active state for tab */
170-
.tab-item.active,
171+
.tab-item.active,
171172
.tab-item:active {
172173
opacity: 1;
173174

scss/_variables.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ $tabs-height: 49px !default;
231231
$tabs-text-font-size: 14px !default;
232232
$tabs-text-font-size-side-icon: 12px !default;
233233
$tabs-icon-size: 32px !default;
234-
$tabs-badge-padding: 2px 6px !default;
234+
$tabs-badge-padding: 1px 6px !default;
235235
$tabs-badge-font-size: 12px !default;
236236
$tabs-text-font-size: 14px !default;
237237

test/html/tab-bars.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Icons On Top Of Text</h1>
2525
</ul>
2626

2727
</main>
28-
28+
2929
<nav id="tab-bar" class="tabs tabs-icon-top">
3030
<a class="tab-item" href="#">
3131
<i class="icon ion-game-controller-a"></i>
@@ -40,7 +40,7 @@ <h1>Icons On Top Of Text</h1>
4040
Simple
4141
</a>
4242
<a class="tab-item has-badge">
43-
<i class="badge">3</i>
43+
<i class="badge badge-assertive">3</i>
4444
<i class="icon ion-leaf"></i>
4545
Light
4646
</a>

0 commit comments

Comments
 (0)