webcomponents / webcomponents/polyfills
[ShadyCSS] Expose prepareTemplate for non template DocumentFragments
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
As briefly suggested at [README.md#usage](https://github.com/webcomponents/shadycss#usage), to support VanillaJS elements I need to use ShadyCSS API manually.
> 1. First, call `ShadyCSS.prepareTemplate(template, name)` on a `` element that will be imported into a `shadowRoot`
The problem is, I usually don't use a `` 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` ;)
Contributor guide
Assessment
This issue has not been assessed yet.