Skip to content

Commit

Permalink
fix(badge): Update badge alignment in tab items, closes #694
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed Mar 1, 2014
1 parent 7cead03 commit c4eed02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions scss/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
@include flex(1);
display: block;
overflow: hidden;

max-width: $tab-item-max-width;
height: 100%;

Expand Down Expand Up @@ -157,8 +157,9 @@
.tab-item .badge {
position: absolute;
padding: $tabs-badge-padding;
top: 2%;
right: 10%;
top: 4%;
right: 33%; // fallback
right: calc(50% - 26px);
font-size: $tabs-badge-font-size;
height: auto;
line-height: $tabs-badge-font-size + 4;
Expand All @@ -167,7 +168,7 @@
/* Navigational tab */

/* Active state for tab */
.tab-item.active,
.tab-item.active,
.tab-item:active {
opacity: 1;

Expand Down
2 changes: 1 addition & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ $tabs-height: 49px !default;
$tabs-text-font-size: 14px !default;
$tabs-text-font-size-side-icon: 12px !default;
$tabs-icon-size: 32px !default;
$tabs-badge-padding: 2px 6px !default;
$tabs-badge-padding: 1px 6px !default;
$tabs-badge-font-size: 12px !default;
$tabs-text-font-size: 14px !default;

Expand Down
4 changes: 2 additions & 2 deletions test/html/tab-bars.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>Icons On Top Of Text</h1>
</ul>

</main>

<nav id="tab-bar" class="tabs tabs-icon-top">
<a class="tab-item" href="#">
<i class="icon ion-game-controller-a"></i>
Expand All @@ -40,7 +40,7 @@ <h1>Icons On Top Of Text</h1>
Simple
</a>
<a class="tab-item has-badge">
<i class="badge">3</i>
<i class="badge badge-assertive">3</i>
<i class="icon ion-leaf"></i>
Light
</a>
Expand Down

0 comments on commit c4eed02

Please sign in to comment.