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) <> storybook_js_hash(@conn)}
>
</script>
<% end %>
<script
nonce={csp_nonce(@conn, :script)}
defer={storybook_js_type(@conn) == "module"}
type="text/javascript"
src={asset_path(@conn, :iframejs)}
>
</script>
<%= if fa_css_path = font_awesome_css_path(@conn) do %>
<link
rel="stylesheet"
nonce={csp_nonce(@conn, :style)}
href={application_static_path(fa_css_path)}
/>
<% else %>
<%= 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/phoenix_storybook_fonts.css")}
/>
<% end %>
<% end %>
<link
rel="stylesheet"
nonce={csp_nonce(@conn, :style)}
href={asset_path(@conn, "css/phoenix_storybook.css")}
/>
<%= if path = storybook_css_path(@conn) do %>
<style nonce={csp_nonce(@conn, :style)}>
@import "<%= path %><%= storybook_css_hash(@conn) %>" layer(app);
</style>
<% 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>