Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Merge branch 'feat/tabs/tabs' into feat/tabs/tab-scroller-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickrodee authored Jul 26, 2018
2 parents 9cbad57 + 932eac2 commit 5205f66
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/mdc-tab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ CSS Class | Description
`mdc-tab__ripple` | Mandatory. Denotes the ripple surface for the tab.
`mdc-tab--active` | Optional. Indicates that the tab is active.
`mdc-tab--stacked` | Optional. Indicates that the tab icon and label should flow vertically instead of horizontally.
`mdc-tab--min-width` | Optional. Indicates that the tab should shrink in size to be as narrow as possible without causing text to wrap.
`mdc-tab__text-label` | Optional. Indicates an icon in the tab.
`mdc-tab__icon` | Optional. Indicates a leading icon in the tab.

Expand All @@ -111,6 +112,7 @@ Mixin | Description
`mdc-tab-text-label-color($color)` | Customizes the color of the tab text label.
`mdc-tab-icon-color($color)` | Customizes the color of the tab icon.
`mdc-tab-parent-positioning` | Sets the positioning of the MDCTab's parent element so that `MDCTab.computeDimensions()` reports the same values in all browsers.
`mdc-tab-fixed-width($width)` | Sets the fixed width of the tab. The tab will never be smaller than the given width.

## `MDCTab` Properties and Methods

Expand Down
4 changes: 4 additions & 0 deletions packages/mdc-tab/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
@mixin mdc-tab-parent-positioning {
position: relative;
}

@mixin mdc-tab-fixed-width($width) {
flex: 0 1 $width;
}
16 changes: 12 additions & 4 deletions packages/mdc-tab/mdc-tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
z-index: 1;
}

.mdc-tab--min-width {
flex: 0 1 auto;
}

.mdc-tab__ripple {
@include mdc-ripple-surface;
@include mdc-ripple-radius-bounded;
Expand All @@ -63,15 +67,19 @@
@include mdc-tab-indicator-surface;

display: flex;
align-items: center;
justify-content: center;
height: inherit;
pointer-events: none;
}

.mdc-tab__text-label,
.mdc-tab__icon {
z-index: 2;
}

.mdc-tab__text-label {
display: inline-block;
padding: 16px 0 20px;
opacity: $mdc-tab-text-label-opacity;
// Setting line-height here overrides the line-height from the typography
// mixin above. The line-height needs to be overridden so that the spacing
Expand All @@ -83,7 +91,6 @@
.mdc-tab__icon {
width: $mdc-tab-icon-size;
height: $mdc-tab-icon-size;
padding: 12px 0;
opacity: $mdc-tab-icon-opacity;
}

Expand All @@ -94,14 +101,15 @@
.mdc-tab--stacked .mdc-tab__content {
flex-direction: column;
align-items: center;
justify-content: space-between;
}

.mdc-tab--stacked .mdc-tab__icon {
padding: 12px 0 8px;
padding-top: 12px;
}

.mdc-tab--stacked .mdc-tab__text-label {
padding: 0 0 16px;
padding-bottom: 16px;
}

// The [de]activation animation affects color for text label and icon
Expand Down

0 comments on commit 5205f66

Please sign in to comment.