Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom HTML for iframe (was 'Using Typekit') #61

Closed
karl opened this issue Apr 6, 2016 · 7 comments
Closed

Custom HTML for iframe (was 'Using Typekit') #61

karl opened this issue Apr 6, 2016 · 7 comments

Comments

@karl
Copy link
Contributor

karl commented Apr 6, 2016

At work we use typekit to load fonts for our components. They are loaded using the simple Typekit embed code (as seen here: https://helpx.adobe.com/typekit/using/embed-codes.html).

The embed code is two script tags like the following:

<script src="https://use.typekit.net/xxxyyy.js"></script>
<script>try{ Typekit.load(); }catch(e){}</script>

I'm not sure of the best route for adding these script tags in to React Storybook, and wondered if anyone had any ideas!

Would React Storybook be interested in supporting customising the HTML of the iframe to enable the script tags to be added. This would also be useful for loading some external CSS that our components currently depend on.

@arunoda
Copy link
Member

arunoda commented Apr 6, 2016

Yes. This would be something great. We could have a file in the .storybook directory as base.html and use it in the iframe.

@jeef3
Copy link
Contributor

jeef3 commented Apr 6, 2016

Also useful for any other CDN links, e.g. Font Awesome.

@karl
Copy link
Contributor Author

karl commented Apr 7, 2016

I've started a PR to enable adding custom html to the iframe, I'd appreciate anyone's thoughts on whether I'm headed in the right direction!

#77

@karl karl changed the title Using Typekit Custom HTML for iframe (was 'Using Typekit') Apr 7, 2016
@arunoda
Copy link
Member

arunoda commented Apr 11, 2016

Check version: v1.10.0. We've #77 in it.

@peisenmann
Copy link

Just to clarify, #77 seems to only cover the <head> whereas this ticket is for customizing the entirety of the iframe html. I'd like, for example, to be able to add a class to the root div for my SCSS styles to be properly namespaced.

@ghost
Copy link

ghost commented Apr 19, 2016

@peisenmann just wrap your story with that div/class.

Thanks for this. Useful for google maps.

@arunoda
Copy link
Member

arunoda commented Apr 19, 2016

I think we can close this now.

@arunoda arunoda closed this as completed Apr 19, 2016
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Make render function of WrapStory pure
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 11, 2017
ndelangen pushed a commit that referenced this issue Apr 23, 2017
ndelangen pushed a commit that referenced this issue May 25, 2017
ndelangen pushed a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants