diff --git a/assets/css/admin/components.css b/assets/css/admin/components.css index 78dab48..9ab3ea0 100644 --- a/assets/css/admin/components.css +++ b/assets/css/admin/components.css @@ -632,15 +632,6 @@ &.active .admin-swap-off { display: none; } } -/* ── Theme toggle ── */ - -.theme-toggle-indicator { - transition: left 150ms cubic-bezier(0.4, 0, 0.2, 1); -} - -[data-theme="light"] .theme-toggle-indicator { left: 33.333333%; } -[data-theme="dark"] .theme-toggle-indicator { left: 66.666667%; } - /* ── Dashboard stats grid ── */ .admin-stats-grid { diff --git a/assets/css/admin/reset.css b/assets/css/admin/reset.css index 2ddc2fb..a80db8a 100644 --- a/assets/css/admin/reset.css +++ b/assets/css/admin/reset.css @@ -1,20 +1,68 @@ -/* Minimal resets for admin pages */ +/* Minimal reset for admin and auth pages. + When shop.css is also loaded (admin pages), the shop reset takes precedence + since both sit in @layer reset. This ensures auth/setup pages still get + baseline resets when shop.css isn't present. */ -*, *::before, *::after { - box-sizing: border-box; -} +@layer reset { + *, + *::before, + *::after { + box-sizing: border-box; + } -body { - margin: 0; - font-family: system-ui, -apple-system, sans-serif; -} + * { + margin: 0; + } -/* Make LiveView wrapper divs transparent for layout */ -[data-phx-session], [data-phx-teleported-src] { - display: contents; -} + html { + height: 100%; + -webkit-text-size-adjust: 100%; + text-size-adjust: 100%; + } -/* Phoenix LiveView loading states */ -.phx-no-feedback.phx-no-feedback { - /* Suppress validation styles until form is interacted with */ + body { + height: 100%; + line-height: 1.5; + -webkit-font-smoothing: antialiased; + } + + img, + picture, + video, + canvas, + svg { + display: block; + max-width: 100%; + } + + input, + button, + textarea, + select { + font: inherit; + color: inherit; + } + + a { + color: inherit; + text-decoration-skip-ink: auto; + } + + button { + background: none; + border: none; + padding: 0; + cursor: pointer; + } + + fieldset { + border: none; + padding: 0; + } + + /* LiveView wrapper divs are layout-invisible */ + [data-phx-session], + [data-phx-teleported-src] { + display: contents; + } } diff --git a/lib/berrypod_web/components/layouts/root.html.heex b/lib/berrypod_web/components/layouts/root.html.heex index eff7964..fe77041 100644 --- a/lib/berrypod_web/components/layouts/root.html.heex +++ b/lib/berrypod_web/components/layouts/root.html.heex @@ -1,5 +1,5 @@ - + @@ -7,30 +7,28 @@ <.live_title default="Berrypod" suffix=" · Phoenix Framework"> {assigns[:page_title]} + + <%= for preload <- Berrypod.Theme.Fonts.preload_links( + @theme_settings.typography, + &BerrypodWeb.Endpoint.static_path/1 + ) do %> + + <% end %> + + + + - - - {@inner_content} + +
+ {@inner_content} +
diff --git a/lib/berrypod_web/router.ex b/lib/berrypod_web/router.ex index 525348e..776dc95 100644 --- a/lib/berrypod_web/router.ex +++ b/lib/berrypod_web/router.ex @@ -14,6 +14,7 @@ defmodule BerrypodWeb.Router do plug :put_secure_browser_headers plug :fetch_current_scope_for_user plug BerrypodWeb.Plugs.CountryDetect + plug BerrypodWeb.Plugs.LoadTheme end pipeline :api do