berrypod/lib/berrypod_web/components/layouts/root.html.heex
jamey 3c9a428d09 extract shared theme CSS into standalone bundle
Move the 3 theme layer imports (primitives, layer2-attributes, semantic)
out of admin.css and shop.css into a new theme.css bundle loaded by all
root layouts. Eliminates 28 KB of duplication on admin pages where both
admin.css and shop.css were each embedding the same theme CSS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:24:47 +00:00

36 lines
1.4 KiB
Plaintext

<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content={get_csrf_token()} />
<.live_title default="Berrypod" suffix=" · Phoenix Framework">
{assigns[:page_title]}
</.live_title>
<!-- Preload critical fonts for the current typography preset -->
<%= for preload <- Berrypod.Theme.Fonts.preload_links(
@theme_settings.typography,
&BerrypodWeb.Endpoint.static_path/1
) do %>
<link rel="preload" href={preload.href} as="font" type="font/woff2" crossorigin />
<% end %>
<!-- Pre-declare layer order so reset < Tailwind base regardless of load order -->
<style>
@layer properties, reset, primitives, tokens, theme, base, components, layout, admin, utilities, overrides;
</style>
<link phx-track-static rel="stylesheet" href={~p"/assets/css/theme.css"} />
<link phx-track-static rel="stylesheet" href={~p"/assets/css/admin.css"} />
<!-- Generated theme CSS with @font-face declarations -->
<style id="theme-css">
<%= Phoenix.HTML.raw(@generated_css) %>
</style>
<script defer phx-track-static src={~p"/assets/js/app.js"}>
</script>
</head>
<body class="h-full">
<div class="themed" data-mood={@theme_settings.mood} style="min-height:100%">
{@inner_content}
</div>
</body>
</html>