webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.14k stars 166 forks source link

[ShadyCSS] Expose prepareTemplate for non template DocumentFragments #26

Open tomalec opened 6 years ago

tomalec commented 6 years ago

As briefly suggested at README.md#usage, to support VanillaJS elements I need to use ShadyCSS API manually.

  1. First, call ShadyCSS.prepareTemplate(template, name) on a <template> element that will be imported into a shadowRoot

The problem is, I usually don't use a <template> to create shadowRoot (see https://github.com/webcomponents/shadycss/issues/144). Creating HTMLTemplateElement for every single string or DocumentFragment I want to put into my Shadow, seems like an overhead.

Could ShadyCSS expose a method to process DocumentFragment or string? Like StyleTransformer ;)

haugthom commented 6 years ago

+1

immersiontravis commented 5 years ago

+1

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.