Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tab): Implement a ripple color mixin for Tab #4421

Merged
merged 7 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 1 addition & 4 deletions demos/tab-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@
@include mdc-tab-fixed-width(120px);
@include mdc-tab-text-label-color($material-color-blue-600);
@include mdc-tab-icon-color($material-color-blue-600);
}

.mdc-tab__ripple {
@include mdc-states($material-color-yellow-700);
@include mdc-tab-ripple-color($material-color-yellow-700);
}

.mdc-tab--active {
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 @@ -20,6 +20,7 @@
// THE SOFTWARE.
//

@import "@material/ripple/mixins";
@import "@material/theme/mixins";

// Public mixins
Expand All @@ -36,6 +37,17 @@
}
}

@mixin mdc-tab-ripple-color($color) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call this mdc-tab-states-color given that it's invoking mdc-states?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea.

Just an aside: the mixed naming between "ripple" and "states" keeps tripping me up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, done.

.mdc-tab__ripple {
@include mdc-states($color);
}
}

@mixin mdc-tab-ink-color($color) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is here... should this also set mdc-tab-icon-color so that everything is set together? (I forget why text and icon color were originally separate, maybe @patrickrodee can weigh in on this.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had separate mixins for text and icon in other components when I added these mixins. Setting icon color in the ink mixin makes sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, my definition of ink was outdated. Done.

@include mdc-tab-text-label-color($color);
@include mdc-tab-ripple-color($color);
}

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