ionic-team/ionicons

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

開放

#960 建立於 2021年4月16日

 (5 則留言) (9 個反應) (0 位負責人)TypeScript (2,083 個分叉)batch import
help wanted

倉庫指標

星標
 (17,256 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

When using it with custom icons : <ion-icon src="assets/icons/wifi.svg"></ion-icon> 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.

貢獻者指南