Skip to content

Commit 409e656

Browse files
andrewseguinmmalerba
authored andcommitted
fix(material-experimental/mdc-tabs): add .mdc-tab__ripple container (#17498)
This matches how MDC shows states, except we do not apply the MDC ripple styles to it for now.
1 parent 646d47f commit 409e656

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/material-experimental/mdc-tabs/_mdc-tabs.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
@include mdc-theme-prop(color, $foreground-color);
6363
}
6464

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

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

79-
.mat-mdc-tab::before,
80-
.mat-mdc-tab-link::before,
79+
.mdc-tab__ripple::before,
8180
.mat-mdc-tab .mat-ripple-element,
8281
.mat-mdc-tab-header-pagination .mat-ripple-element,
8382
.mat-mdc-tab-link .mat-ripple-element {

src/material-experimental/mdc-tabs/_tabs-common.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $mat-tab-animation-duration: 500ms !default;
2424

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

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

4444
&.cdk-program-focused,
4545
&.cdk-keyboard-focused {
46-
&::before {
46+
.mdc-tab__ripple::before {
4747
opacity: map-get($mdc-ripple-dark-ink-opacities, focus);
4848
}
4949
}

src/material-experimental/mdc-tabs/tab-group.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
[class.mdc-tab--active]="selectedIndex == i"
2222
[disabled]="tab.disabled"
2323
(click)="_handleClick(tab, tabHeader, i)">
24+
<span class="mdc-tab__ripple"></span>
2425

2526
<!-- Needs to be a separate element, because we can't put
2627
`overflow: hidden` on tab due to the ink bar. -->

src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<span class="mdc-tab__ripple"></span>
2+
13
<div
24
class="mat-mdc-tab-ripple"
35
mat-ripple
@@ -9,3 +11,4 @@
911
<ng-content></ng-content>
1012
</span>
1113
</span>
14+

0 commit comments

Comments
 (0)