angular / angular/components

One syntax for all types of mat-icon

Đang mở
#12,484 3 bình luận 5 reaction 0 người được giao Xem trên GitHub
area: material/icon feature 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ả

#### Bug, feature request, or proposal:

Feature request

#### What is the expected behavior?

Changing between ligature-based and class-based icon specification shouldn't be a huge chore.

#### What is the current behavior?

To use ligature-based icons, I write `home`. If I want to change from an icon font to a font set that uses CSS classes to pick a glyph, I'd have to change each component by hand to something like ``.

#### What is the use-case or motivation for changing an existing behavior?

I've created a large application that uses dozens of `mat-icon` components, and would like a simple method of changing how they're rendered. Ideally, I'd be able to call something like `setDefaultFontSetClass` once and have all icons (that don't explicitly set a `fontSet` attribute) change their source.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?

N/A, mat-icon has always behaved like this

#### Is there anything else we should know?

It would be great if either the `fontIcon` attribute or the component content could be used to select a glyph regardless of how the font set is provided, but I'd be happy to be told to just always use one or the other, as long as switching between types of font set using the icon registry is straightforward.

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

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

Hướng nghiên cứu

Bắt đầu bằng cách đọc hành vi của component mat-icon và các API của icon registry được mô tả trong issue, tập trung vào cách nội dung ligature, fontIcon và fontSet được chọn. Công việc được xem là hoàn thành khi một ứng dụng lớn hiện có có thể chuyển đổi giữa các nguồn icon dựa trên ligature và dựa trên class thông qua một cấu hình mặc định duy nhất mà không cần chỉnh sửa từng chỗ sử dụng mat-icon.

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
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
35/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.