Packages
A pluggable storybook for your Phoenix components.
Security advisory:
This version has known vulnerabilities.
View advisories
Current section
Files
Jump to
Current section
Files
lib/phoenix_storybook/templates/layout/root_iframe.html.heex
<!DOCTYPE html>
<html lang="en" phx-socket={live_socket_path(@conn)} style="height: 100%; margin: 0;">
<head>
<%= if csrf?(@conn) do %>
{csrf_meta_tag()}
<% end %>
<%= if path = storybook_js_path(@conn) do %>
<script
nonce={csp_nonce(@conn, :script)}
phx-track-static
type={storybook_js_type(@conn)}
src={application_static_path(path)}
>
</script>
<% end %>
<script
nonce={csp_nonce(@conn, :script)}
type="text/javascript"
src={asset_path(@conn, "js/iframe.js")}
>
</script>
<%= if fa_kit_id = fa_kit_id(@conn) do %>
<link
rel="stylesheet"
href={"https://kit.fontawesome.com/#{fa_kit_id}.css"}
crossorigin="anonymous"
/>
<% else %>
<link
rel="stylesheet"
nonce={csp_nonce(@conn, :style)}
href={asset_path(@conn, "css/fonts.css")}
/>
<% end %>
<link
rel="stylesheet"
nonce={csp_nonce(@conn, :style)}
href={asset_path(@conn, "css/app.css")}
/>
<%= if path = storybook_css_path(@conn) do %>
<link
nonce={csp_nonce(@conn, :style)}
phx-track-static
rel="stylesheet"
href={application_static_path(path)}
/>
<% end %>
</head>
<% container =
if assigns[:story],
do: normalize_story_container(assigns[:story].container()),
else: {:div, []} %>
<body class={sandbox_class(@conn, container, assigns)} style="margin: 0;">
{@inner_content}
</body>
</html>