Skip to content

fix(material/tabs): coloring issues when a backgroundColor is set #22612

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
May 7, 2021
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: 4 additions & 1 deletion src/material-experimental/mdc-tabs/_tabs-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ $mat-tab-animation-duration: 500ms !default;
.mat-mdc-tab-header-pagination-disabled {
box-shadow: none;
cursor: default;
opacity: 0.4;
pointer-events: none;

.mat-mdc-tab-header-pagination-chevron {
opacity: 0.4;
}
}

.mat-mdc-tab-list {
Expand Down
12 changes: 9 additions & 3 deletions src/material-experimental/mdc-tabs/_tabs-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@
@include mdc-theme.prop(color, $foreground-color);
}

.mdc-tab-indicator__content--underline,
.mat-mdc-tab-header-pagination-chevron,
.mat-mdc-focus-indicator::before {
@include mdc-theme.prop(border-color, $foreground-color);
}
}

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

.mdc-tab-indicator__content--underline, .mat-mdc-tab-header-pagination-chevron,
.mat-mdc-focus-indicator::before,
.mat-mdc-focus-indicator::before {
.mat-mdc-tab-header-pagination-chevron {
@include mdc-theme.prop(border-color, $foreground-color);
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/material-experimental/mdc-tabs/tab-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
@include tabs-common.paginated-tab-header-container;
}

.mat-mdc-tab-header-pagination-disabled {
box-shadow: none;
cursor: default;
opacity: 0.4;
}

.mat-mdc-tab-labels {
@include tabs-common.paginated-tab-header-item-wrapper('.mat-mdc-tab-header');
}
7 changes: 5 additions & 2 deletions src/material/tabs/_tabs-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,23 @@
}

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

> .mat-tab-header .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron,
> .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron {
border-color: theming.get-color-from-palette($background-color, default-contrast, 0.4);
}

// Set ripples color to be the contrast color of the new background. Otherwise the ripple
// color will be based on the app background color.
> .mat-tab-header .mat-ripple-element,
> .mat-tab-link-container .mat-ripple-element {
> .mat-tab-link-container .mat-ripple-element,
> .mat-tab-header-pagination .mat-ripple-element {
background-color: theming.get-color-from-palette($background-color, default-contrast, 0.12);
}
}
Expand Down