question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Isolating components in iframe

See original GitHub issue

Feature request

What problem does this feature solve?

Styles intersection.

What does the proposed API look like?

Users components might be wrapped with iframe.

How should this be implemented in your opinion?

As a plugin.

Are you willing to work on this yourself?

Yes, but for now I don’t know where to start.

Okay, I am developing design system and vue components library and found that my components styles are overwritten by vuepress default theme. Specifically component like table, etc. So it would be great if we can develop plugin/component which will render provided component in iframe.

Example:

<v-frame>
  <my-button>My isolated button</button>
</v-frame>

This might be extremely useful for UI library authors.

I’d develop this plugin/component but need to help to figure out how to throw styles into iframe?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
timaschewcommented, Apr 20, 2019

No, it’s my library. I’m using vuepress to build a documentation for it.

One reason more not to use iframes.
Just use more specific selectors or variables.

2reactions
timaschewcommented, Sep 30, 2019

Just use a shadow DOM, then your styles will be isolated, they can only be overwritten by variables, which you can control by giving a unique name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do Web Components now support iframe-like security isolation?
Simple answer: No. Web Components Do not isolate JS. Just DOM and CSS. But you can put all of your JS within your...
Read more >
How to Use The Shadow Dom To Isolate Styles on a ... - Courier
In this post, we will explain, in great detail, how to use Shadow DOM as an API for DOM encapsulation. Perfect for when...
Read more >
Bringing componentization to the web - Windows Blog
The goal of web components is to reduce complexity by isolating a related ... Global object isolation; Element encapsulation (the iframe) ...
Read more >
The ultimate guide to iframes - LogRocket Blog
Because an iframe offers an isolated environment, this means that the focus or the selection is never lost when you are clicking outside...
Read more >
Browser code isolation
HOW CAN WE RESTRICT. EXECUTION AND. COMMUNICATION? Page 27. Two ways to restrict execution. HTML5 iframe Sandbox. ▫ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found