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.

Add ability to specify a class for the preview iframe <html>

See original GitHub issue

Please add the ability to specify a class (dark for example) that gets added to the <html> of the preview iframe. This is similar to what https://github.com/tonai/storybook-addon-themes does.

Setting a class on the <html> is enough for me to add CSS that changes the CSS variables so my web components are also in dark mode.

See https://github.com/tonai/storybook-addon-themes/blob/master/src/manager/ThemeStory.tsx#L17 for the code that does this.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hipstersmoothiecommented, Jul 10, 2020

Maybe try clearing localStorage for your storybook

0reactions
hipstersmoothiecommented, Jul 10, 2020

Odd. If you make a PR I’ll merge and release promptly! don’t have the time right now to look at this

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML iframe tag
The <iframe> tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document.
Read more >
Building HTML, CSS, and JS code preview using iframe's ...
This proves the feasibility to build code previews using iframes. You can stop here and experiment with the idea yourself, or you might...
Read more >
The ultimate guide to iframes
Developers mainly use the iframe tag to embed another HTML document within the ... I needed to list them to let him preview...
Read more >
How to apply CSS to iframe? - html
Edit: This does not work cross domain unless the appropriate CORS header is set. There are two different things here: the style of...
Read more >
How to Inject Custom HTML and CSS into an iFrame - YouTube
Ever been to a site like JSBin, where you can write HTML, CSS, and JavaScript, and then see the results in a panel...
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