angular / angular/components

bug(MatTable): Text-color are no longer taken from the predefined foreground palette

Ouverte
#26,153 30 commentaires 42 réactions 0 personnes assignées Voir sur GitHub
area: material/table P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Is this a regression?

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

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

14

### Description

After the angular material 15 update, the component text colors are no longer taken from the predefined foreground palette. In the past there was taken from the text and secondary-text variable.

Is there a new smart way to force the use of specific text-colors? Or is it not advisable to use your own font colors?

### Reproduction

https://stackblitz.com/run?file=src%2Fapp%2Ftable-basic-example.ts

### Expected Behavior

Its possible to use the foreground color palette to customize the text-color.

```scss
$theme-foreground-palette: (
base: color.$grey-700,
divider: color.$dividers,
dividers: color.$dividers,
disabled: color.$disabled-text,
disabled-button: color.$grey-400,
disabled-text: color.$disabled-text,
elevation: color.$grey-700,
hint-text: color.$disabled-text,
secondary-text: color.$secondary-text, // <-- was also used for mat-header-cells
icon: color.$primary-text,
icons: color.$primary-text,
text: color.$primary-text, // <-- was also used for mat-cells
slider-min: color.$grey-700,
slider-off: color.$grey-200,
slider-off-active: color.$grey-300,
);
```

### Actual Behavior

Some parts from the foreground palette will affect in the theme for the app. But in lists, tables or options there is always used the color `rgba(0, 0, 0, 0.87)`.

### Environment

- Angular: 15.0.2
- CDK/Material: 15.0.1

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée, en particulier src/app/table-basic-example.ts, et comparez le comportement des thèmes Angular Material 14 et 15. Suivez la manière dont les valeurs de texte et de texte secondaire de la palette de premier plan atteignent les cellules et les en-têtes du tableau ; le travail est terminé lorsque la palette configurée contrôle ces couleurs au lieu de rgba(0, 0, 0, 0.87).

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.