Skip to content

Commit

Permalink
fix(tabs): improved vertical alignment of tab label (#5771)
Browse files Browse the repository at this point in the history
Uses inline flex to align the tab label content. This is more reliable and more flexible. It also allows us to have multi-line text in the tabs, if we decide that we want to support it.
  • Loading branch information
crisbeto authored and andrewseguin committed Jul 25, 2017
1 parent 39c3e42 commit b105039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/lib/tabs/_tabs-common.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
@import '../core/style/variables';

$mat-tab-bar-height: 48px !default;

$mat-tab-animation-duration: 500ms !default;

// Mixin styles for labels that are contained within the tab header.
@mixin tab-label {
line-height: $mat-tab-bar-height;
height: $mat-tab-bar-height;
padding: 0 12px;
cursor: pointer;
box-sizing: border-box;
opacity: 0.6;
min-width: 160px;
text-align: center;
display: inline-flex;
justify-content: center;
align-items: center;
white-space: nowrap;

&:focus {
outline: none;
Expand Down
1 change: 0 additions & 1 deletion src/lib/tabs/tab-nav-bar/tab-nav-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// Wraps each link in the header
.mat-tab-link {
@include tab-label;
display: inline-block;
vertical-align: top;
text-decoration: none; // Removes anchor underline styling
position: relative;
Expand Down

0 comments on commit b105039

Please sign in to comment.