ionic-team / ionic-team/ionicons

Can you expose a part="svg" for the SVG content

未关闭
#960 5 条评论 9 个 reaction 已指派 0 人 在 GitHub 查看
help wanted
主要语言
TypeScript
星标
18.2k
派生
2.1k
PR 合并指标
30 天内没有已合并 PR

描述

When using it with custom icons : ``
Because of the Shadow DOM we can't style at all the content of the SVG. Any custom SVG used is always a square because of the this css lines :
https://github.com/ionic-team/ionicons/blob/8c2a507fcff2cb5f2edff60357ffd7feb70bb987/src/components/icon/icon.css#L27-L34
By adding a `part="svg"` it would be possible to have more flexibility to style the SVG from the outside. In my case setting height to auto, but it could be to change the color of a specific path or anything else.

贡献指南

打开贡献指南

调研方向

Start with src/components/icon/icon.css lines 27-34 and the icon component rendering used by . Confirm how the custom SVG is inserted, then expose the SVG with part="svg" so callers can style it from outside the Shadow DOM. Done means external styling can target the SVG, including changing its sizing behavior.

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

评估

技术栈
typescript
领域
frontend, web-dev
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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