ant-design-icons icon indicating copy to clipboard operation
ant-design-icons copied to clipboard

Add `attachTo` to IconContext?

Open jacobweberbowery opened this issue 2 years ago • 4 comments

Would it be possible to add an optional attachTo property to IconContext, that gets passed through to updateCSS when you call useInsertStyles? The updateCSS function already supports this.

The use case is that I'd like to include an icon within a Web Component's shadow DOM. I want the style sheet to be inserted inside the shadow DOM, instead of the document head, so it only affects the component.

So it would ideally support ShadowRoot elements as well as other Element types.

jacobweberbowery avatar Apr 20 '22 21:04 jacobweberbowery

+1

noru avatar Dec 06 '22 08:12 noru

willing to accept a PR?

noru avatar Dec 06 '22 08:12 noru

related: https://github.com/ant-design/ant-design/issues/38911

noru avatar Dec 06 '22 09:12 noru

@noru Did you find a workaround other than manually copy/past the styles inside the shadow?

Psvensso avatar Mar 13 '23 08:03 Psvensso