Skip to content

Bug/Question: LitElement rendering into multiple iframes no styles with constructable stylesheets #1139

Closed
@daKmoR

Description

@daKmoR

I'm rendering a component into multiple iframes

render(html`<foo-el></foo-el>`, iframe1.contentDocument.body);
render(html`<foo-el></foo-el>`, iframe2.contentDocument.body);

and I'm already amazed that I don't need to redefine all custom elements in those iframes...
however due to LitElement using constructable stylesheets... those stylesheets are only available in the "parent" window...
any way I can bring them along?

funny enough it works fine in browser that don't support constructable stylesheets as then it will create style tags in the shadow dom 😅

===> Live Demo at https://codepen.io/daKmoR/pen/XWjwdRb?editors=1000 <<===

Question

is that the intended behaviour? or should it register the stylesheet in every document it get's added 🤔

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions