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(tabs): support stretched tabs in mat-tab-nav-bar #10368

Merged
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
1 change: 0 additions & 1 deletion src/lib/tabs/tab-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
}
}

.mat-tab-group[mat-stretch-tabs] .mat-tab-label,
.mat-tab-group[mat-stretch-tabs] .mat-tab-label {
flex-basis: 0;
flex-grow: 1;
Expand Down
7 changes: 7 additions & 0 deletions src/lib/tabs/tab-nav-bar/tab-nav-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

.mat-tab-links {
position: relative;
display: flex;
}

// Wraps each link in the header
Expand All @@ -17,8 +18,14 @@
text-decoration: none; // Removes anchor underline styling
position: relative;
overflow: hidden; // Keeps the ripple from extending outside the element bounds

[mat-stretch-tabs] & {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be the same css targeting as for regular tabs?

Regular tabs are:
.mat-tab-group[mat-stretch-tabs] .mat-tab-label

Tab nav is:
.mat-tab-link[mat-stretch-tabs]

Should it be?
mat-tab-links .mat-tab-link[mat-stretch-tabs]

Copy link
Member Author

Choose a reason for hiding this comment

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

This selector will end up being transpiled to [mat-stretch-tabs] .mat-tab-link. The only difference is that I didn't prepend the .mat-tab-links, but I wanted to make the selector less specific.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, apparently I was not fully awake when I read this selector. I see it now. Awesome.

flex-basis: 0;
flex-grow: 1;
}
}


@media ($mat-xsmall) {
.mat-tab-link {
min-width: 72px;
Expand Down