feat(icon): Benefit of <use> and <symbol>

Đang mở
#34,105 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Start by reading MatIconRegistry and the mat-icon rendering path to see how registered SVGs are copied into each component. Explore whether a document-level hidden SVG symbol can be reused through <use href="#namespace-icon-id"></use>. Done means repeated icons use a shared symbol and the DOM contains less repeated SVG; the issue gives no test or implementation files to start from.

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

Mô tả

area: material/icon feature needs triage
Feature Description

Currently MatIconRegistry copy SVG code of each added icons in each mat-icon component.
Why not add an SVG symbol hidden in the current document and only use <use href="#namespace-icon-id"></use> where the icon should be displayed ?

Use Case

Reduce the amount of SVG in DOM when the same icon is repeated a lot of time in the same page.

Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.9k
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
83

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/components

Tất cả issue của angular/components

Issue tương tự

Thêm issue về TypeScript

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.