diff --git a/src/dev-app/tabs/tabs-demo.html b/src/dev-app/tabs/tabs-demo.html index 2ba57c5166d9..5d77820d1d44 100644 --- a/src/dev-app/tabs/tabs-demo.html +++ b/src/dev-app/tabs/tabs-demo.html @@ -26,3 +26,5 @@

Inverted Tabs

Ink bar fit to content

+

Tab group with the headers on the bottom

+ diff --git a/src/material-experimental/theming/_custom-tokens.scss b/src/material-experimental/theming/_custom-tokens.scss index 709fe70a3166..bbaa42a01d1a 100644 --- a/src/material-experimental/theming/_custom-tokens.scss +++ b/src/material-experimental/theming/_custom-tokens.scss @@ -578,6 +578,8 @@ @return mat.private-merge-all( _generate-typography-tokens($systems, label-text, title-small), ( + divider-color: map.get($systems, md-sys-color, surface-variant), + divider-height: 1px, disabled-ripple-color: null, // TODO(mmalerba): Figure out correct value. pagination-icon-color: map.get($systems, md-sys-color, on-surface), inactive-label-text-color: map.get($systems, md-sys-color, on-surface), diff --git a/src/material/core/tokens/m2/mat/_tab-header.scss b/src/material/core/tokens/m2/mat/_tab-header.scss index 541fbd7d17af..deaebf6ac72f 100644 --- a/src/material/core/tokens/m2/mat/_tab-header.scss +++ b/src/material/core/tokens/m2/mat/_tab-header.scss @@ -8,7 +8,12 @@ $prefix: (mat, tab-header); // Tokens that can't be configured through Angular Material's current theming API, // but may be in a future version of the theming API. @function get-unthemable-tokens() { - @return (); + @return ( + // For some period of time, the MDC tabs removed the divider. This has been added back in + // and will be present in M3. + divider-color: transparent, + divider-height: 0, + ); } // Tokens that can be configured through Angular Material's color theming API. diff --git a/src/material/tabs/_tabs-common.scss b/src/material/tabs/_tabs-common.scss index 6f70bb725a95..0db2aba1998a 100644 --- a/src/material/tabs/_tabs-common.scss +++ b/src/material/tabs/_tabs-common.scss @@ -338,11 +338,30 @@ $mat-tab-animation-duration: 500ms !default; } // Structural styles for the element that wraps the paginated container's content. -@mixin paginated-tab-header-container { +// Include a selector for an inverted header if the header may be optionally positioned on the +// bottom of the content. +@mixin paginated-tab-header-container($inverted-header-selector: null) { display: flex; flex-grow: 1; overflow: hidden; z-index: 1; + @include token-utils.use-tokens( + tokens-mat-tab-header.$prefix, + tokens-mat-tab-header.get-token-slots() + ) { + border-bottom-style: solid; + @include token-utils.create-token-slot(border-bottom-width, divider-height); + @include token-utils.create-token-slot(border-bottom-color, divider-color); + + @if ($inverted-header-selector) { + #{$inverted-header-selector} & { + border-bottom: none; + border-top-style: solid; + @include token-utils.create-token-slot(border-top-width, divider-height); + @include token-utils.create-token-slot(border-top-color, divider-color); + } + } + } } @mixin paginated-tab-header-with-background($header-selector, $tab-selector) { diff --git a/src/material/tabs/tab-header.scss b/src/material/tabs/tab-header.scss index 5dad511323ae..2dfe19723a02 100644 --- a/src/material/tabs/tab-header.scss +++ b/src/material/tabs/tab-header.scss @@ -4,7 +4,7 @@ @include tabs-common.paginated-tab-header; .mat-mdc-tab-label-container { - @include tabs-common.paginated-tab-header-container; + @include tabs-common.paginated-tab-header-container('.mat-mdc-tab-group-inverted-header'); } .mat-mdc-tab-labels {