Skip to content

Commit

Permalink
fix(material/tabs): strong focus indicator not visible when tab heade…
Browse files Browse the repository at this point in the history
…r has a background (#21402)

`mat-tab-group` has the ability to theme both the foreground and background. When
the background color is different from the default, the strong focus indicator blends
into it, making it invisible.

These changes invert the color of the indicator so it stands out.

(cherry picked from commit 16f2a60)
  • Loading branch information
crisbeto authored and annieyw committed Feb 5, 2021
1 parent c222618 commit 8e6b2c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/material-experimental/mdc-tabs/_tabs-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
@include mdc-theme-prop(background-color, $foreground-color);
}

.mdc-tab-indicator__content--underline, .mat-mdc-tab-header-pagination-chevron {
.mdc-tab-indicator__content--underline, .mat-mdc-tab-header-pagination-chevron,
.mat-mdc-focus-indicator::before,
.mat-mdc-focus-indicator::before {
@include mdc-theme-prop(border-color, $foreground-color);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/material/tabs/_tabs-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@
}

// Set pagination chevrons to contrast background
> .mat-tab-header-pagination .mat-tab-header-pagination-chevron {
> .mat-tab-header-pagination .mat-tab-header-pagination-chevron,
> .mat-tab-links .mat-focus-indicator::before,
> .mat-tab-header .mat-focus-indicator::before {
border-color: mat-color($background-color, default-contrast);
}

Expand Down

0 comments on commit 8e6b2c5

Please sign in to comment.