angular / angular/components

Refactor SVG inlining from md-icon into cdk-svg

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

描述

The SVG inlining features of md-icon are more generally useful than for just displaying icons. We should refactor the code such that:
* The SVG portions of `MdIconRegistry` are moved to `IconRegistry` in the cdk, with `MdIconRegistry` then extending `IconRegistry`
* The SVG inlining code in `md-icon` is moved into `cdk-svg` with `md-icon` then consuming `cdk-svg`.

This will enable us to add additional APIs to `cdk-svg` around customizing `viewBox` and `preserveAspectRatio` (see https://css-tricks.com/scale-svg)

Notes:
* Part of this should be moving SVG parsing (i.e. `string` -> `SVGElement`) into its own utility that can be mocked. This will be useful when ensuring that parsing only happens when expected (since it can have performance impacts if overdone).

贡献指南

打开贡献指南

调研方向

找到 MdIconRegistry 当前的 SVG 部分以及 md-icon 使用的 SVG 内联代码,然后将它们与 cdk IconRegistry 和 cdk-svg 入口进行比较。当 SVG 注册表行为和内联由 CDK 提供、MdIconRegistry 扩展 IconRegistry、md-icon 使用 cdk-svg,并且 SVG 解析被隔离到可模拟的实用工具中时,重构就完成了。

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

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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