angular / angular/components

bug(TABS): tabs with fitInkBarToContent does not follow Material 3 design specs

Open
#30,375 0 comments 0 reactions 0 assignees View on GitHub
area: material/tabs P2
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

As per [Material 3 guidelines](https://m3.material.io/components/tabs/specs), primary tabs should have active indicator's height of `3px` and shape of `3px 3px 0 0`. In Angular Material, primary tabs' behaviour can be achieved using `[fitInkBarToContent]=true` input.

But, they have height of `2px`, and shape of `0`, which is right only for secondary tabs.

We can override it by using `tabs-overrides` mixin like below:

```scss
@use '@angular/material' as mat;

[fitInkBarToContent],
[ng-reflect-fit-ink-bar-to-content='true'] {
> .mat-mdc-tab-header {
@include mat.tabs-overrides(
(
active-indicator-shape: 3px 3px 0 0,
active-indicator-height: 3px,
)
);
}
}
```

But, it should be the default behaviour as per Material 3 specs.

### Reproduction

Not needed.

### Expected Behavior

Tabs with `[fitInkBarToContent]=true` should have active indicator's height of `3px` and shape of `3px 3px 0 0`.

### Actual Behavior

Tabs with `[fitInkBarToContent]=true` have active indicator's height of `2px`, and shape of `0`.

### Environment

- Angular: 19
- CDK/Material: 19
- Browser(s): Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start at Angular Material's tabs implementation and the tabs-overrides mixin, tracing the fitInkBarToContent path and the active-indicator styles on .mat-mdc-tab-header. Done means this input produces a 3px active indicator with a 3px 3px 0 0 shape, matching the stated Material 3 expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, scss, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.