feat(Toolbar & Tabs): support more density scale levels in Toolbar or Tabs
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### Feature Description
Currently there are these densities supported for Tabs:
https://github.com/angular/components/blob/a7f87a80a18a62d75a8c5621fd89dbc2cf28a865/src/material/core/tokens/m2/mdc/_tab.scss#L69

and these for Toolbar:
https://github.com/angular/components/blob/a7f87a80a18a62d75a8c5621fd89dbc2cf28a865/src/material/core/tokens/m2/mat/_toolbar.scss#L38

From these `scale levels vs height in pixels` maps we can see that the highest Tabs have their Tab Header 48px high and the lowest Toolbar is 52px high (on desktop). This means these two components never get the same height regardless the density applied.
In case they are used next to each other, when Tabs are used as kind of a 'toolbar' on a screen, it causes a visual discrepancy. Here is a demonstration where default 0 density is used for Tabs and -3 density used for Toolbars:
https://stackblitz.com/edit/egbtbh?file=src%2Ftheme.scss

This may look as a tiny problem, but the Design, Business or QA departments may have very attentive eyes and report this as a visual bug (as it happened in my team). I am trying to avoid changing the heights with some custom CSS as this is not an approach recommended by Angular Material team as per this section in the official docs: https://material.angular.io/guide/customizing-component-styles#targeting-custom-styles

Therefore my question is, would it be please possible to add more density scale levels for either Tabs or Toolbar and still be compliant to the Material Design specs? Or maybe the whole use case of having Tabs next to a Toolbar is not correct from the Material Design specs point of view and I should ask our Design department to fix the designs?
### Use Case
_No response_
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par comparer les définitions de densité dans src/material/core/tokens/m2/mdc/_tab.scss et src/material/core/tokens/m2/mat/_toolbar.scss. Reproduisez l’écart dans l’exemple StackBlitz lié et examinez les recommandations de Material Design liées dans l’issue. Le travail sera considéré comme terminé lorsqu’il aura été déterminé si des niveaux de densité supplémentaires sont appropriés et qu’un résultat cohérent aura été documenté ou implémenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- design, frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100