angular / angular/components

One syntax for all types of mat-icon

未关闭
#12,484 3 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
area: material/icon feature P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

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

贡献指南

打开贡献指南

调研方向

首先阅读 issue 中描述的 mat-icon 组件行为和图标注册表 API,重点关注如何选择连字内容、fontIcon 和 fontSet。完成的标准是:大型现有应用可以通过一个默认配置,在基于连字和基于类的图标源之间切换,而无需编辑每一处 mat-icon 的使用。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。