styleguidist/react-styleguidist

Try rendering examples in iframe

Open

#1,496 创建于 2019年12月12日

在 GitHub 查看
 (4 评论) (2 反应) (0 负责人)TypeScript (1,416 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (11,091 star)
PR 合并指标
 (PR 指标待抓取)

描述

Right now each example is a separate React app that renders into the same DOM as the Styleguidist app itself. This approach have some problems:

  • We share styles between Styleguidist and user's component, we use some hacks to isolate Stylegudist styles but sometimes styles still affect each other.
  • We can't implement a nice responsive design preview, because we can't affect media queries in components without resizing the window.

Possible issues of the iframe approach:

  • It could be slower than the current approach.
  • Interaction between Styleguidist and iframes could be more complex.
  • We'll need to add global styles to every iframe instead of adding them once at the Styleguidst root level.

贡献者指南