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

feat(tab): Add Tab Sass mixins targeting active state colors #4522

Merged
merged 8 commits into from
Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions demos/tab-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@
@include mdc-tab-text-label-color($material-color-blue-600);
@include mdc-tab-icon-color($material-color-blue-600);
@include mdc-tab-states-color($material-color-yellow-700);
}

.mdc-tab--active {
@include mdc-tab-text-label-color($material-color-blue-900);
@include mdc-tab-icon-color($material-color-blue-900);
@include mdc-tab-active-text-label-color($material-color-blue-900);
@include mdc-tab-active-icon-color($material-color-blue-900);
}

.mdc-tab-indicator {
Expand Down
2 changes: 2 additions & 0 deletions packages/mdc-tab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ Mixin | Description
`mdc-tab-icon-color($color)` | Customizes the color of the tab icon.
`mdc-tab-states-color($color)`| Customizes the base states color, which affects hover/focus states and the press ripple.
`mdc-tab-ink-color($color)` | Customizes the text label, icon, and base states color.
`mdc-tab-active-text-label-color($color)` | Customizes the color of the active tab's text label.
`mdc-tab-active-icon-color($color)` | Customizes the color of the active tab's 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.

Expand Down
12 changes: 12 additions & 0 deletions packages/mdc-tab/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
@include mdc-tab-text-label-color($color);
}

@mixin mdc-tab-active-text-label-color($color) {
&.mdc-tab--active {
@include mdc-tab-text-label-color($color);
}
}

@mixin mdc-tab-active-icon-color($color) {
&.mdc-tab--active {
@include mdc-tab-icon-color($color);
}
}

@mixin mdc-tab-parent-positioning {
position: relative;
}
Expand Down