angular / angular/components

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

Đang mở
#26,153 30 bình luận 42 reaction 0 người được giao Xem trên GitHub
area: material/table P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết, đặc biệt là src/app/table-basic-example.ts, và so sánh cách hoạt động của theme Angular Material 14 và 15. Theo dõi cách các giá trị text và secondary-text của foreground palette được truyền đến các ô và tiêu đề bảng; hoàn tất khi palette đã cấu hình kiểm soát các màu đó thay vì rgba(0, 0, 0, 0.87).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.