Skip to content

fix(material-experimental/mdc-tabs): add .mdc-tab__ripple container #17498

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

Merged
merged 1 commit into from
Oct 24, 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
5 changes: 2 additions & 3 deletions src/material-experimental/mdc-tabs/_mdc-tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
@include mdc-theme-prop(color, $foreground-color);
}

.mat-ripple-element, .mat-mdc-tab::before {
.mat-ripple-element, .mdc-tab__ripple::before {
@include mdc-theme-prop(background-color, $foreground-color);
}

Expand All @@ -76,8 +76,7 @@
@include mdc-tab-indicator-underline-color($color, $query: $mat-theme-styles-query);
@include mdc-tab-indicator-icon-color($color, $query: $mat-theme-styles-query);

.mat-mdc-tab::before,
.mat-mdc-tab-link::before,
.mdc-tab__ripple::before,
.mat-mdc-tab .mat-ripple-element,
.mat-mdc-tab-header-pagination .mat-ripple-element,
.mat-mdc-tab-link .mat-ripple-element {
Expand Down
6 changes: 3 additions & 3 deletions src/material-experimental/mdc-tabs/_tabs-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $mat-tab-animation-duration: 500ms !default;

// Used to render out the background tint when hovered/focused. Usually this is done by
// MDC's ripple styles, however we're using our own ripples due to size concerns.
&::before {
.mdc-tab__ripple::before {
content: '';
display: block;
position: absolute;
Expand All @@ -37,13 +37,13 @@ $mat-tab-animation-duration: 500ms !default;
}

// We need to handle the hover and focus indication ourselves, because we don't use MDC's ripple.
&:hover::before {
&:hover .mdc-tab__ripple::before {
opacity: map-get($mdc-ripple-dark-ink-opacities, hover);
}

&.cdk-program-focused,
&.cdk-keyboard-focused {
&::before {
.mdc-tab__ripple::before {
opacity: map-get($mdc-ripple-dark-ink-opacities, focus);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/material-experimental/mdc-tabs/tab-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
[class.mdc-tab--active]="selectedIndex == i"
[disabled]="tab.disabled"
(click)="_handleClick(tab, tabHeader, i)">
<span class="mdc-tab__ripple"></span>

<!-- Needs to be a separate element, because we can't put
`overflow: hidden` on tab due to the ink bar. -->
Expand Down
3 changes: 3 additions & 0 deletions src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<span class="mdc-tab__ripple"></span>

<div
class="mat-mdc-tab-ripple"
mat-ripple
Expand All @@ -9,3 +11,4 @@
<ng-content></ng-content>
</span>
</span>