Dough Git

commit

Add branding to site

commit
1cb02f211adf987910b66436499d8b0afc5ecc94
author
Clove Twilight <[email protected]>
date
2026-09-07 07:05

diff --git a/apps/web/src/app/admin/layout.tsx b/apps/web/src/app/admin/layout.tsx
index 74d6ef3..416a851 100644
--- a/apps/web/src/app/admin/layout.tsx
+++ b/apps/web/src/app/admin/layout.tsx
@@ -3,6 +3,7 @@ import { notFound, redirect } from "next/navigation";
 import { Award, BoxArrowUpRight, JournalText, People } from "react-bootstrap-icons";
 import { isAuthenticated, isPlatformAdmin } from "@/lib/manage-api.ts";
 import { webConfig } from "@/lib/config.ts";
+import { Logo } from "@/components/Logo.tsx";
 
 export const metadata: Metadata = {
   title: { default: "Admin", template: "%s · Admin · pkviewer" },
@@ -26,7 +27,10 @@ export default async function AdminLayout({ children }: { children: React.ReactN
   return (
     <div className="mg">
       <header className="mg-bar">
-        <a className="mg-brand" href="/admin">pkviewer</a>
+        <a className="mg-brand" href="/admin">
+          <Logo />
+          pkviewer
+        </a>
         <span className="mg-bar-note">Administration</span>
         <span className="spacer" />
         <a className="btn" href="/manage">Management</a>
diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css
index 426dc4b..d156f3b 100644
--- a/apps/web/src/app/globals.css
+++ b/apps/web/src/app/globals.css
@@ -100,8 +100,23 @@ a:focus-visible, button:focus-visible {
 }
 
 img { max-width: 100%; height: auto; display: block; }
+
 code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; }
 
+/* The logo mark.
+ *
+ * It carries no themed colour and no palette of its own, so ONE rule serves the
+ * public pages and the control plane alike — only the size differs, and that
+ * comes from `--brand-mark-size` on whatever the mark sits in. Overriding the
+ * global `height: auto` above is the point: the height is what gets chosen, and
+ * the width follows from the artwork's own ratio.
+ */
+.brand-mark {
+  height: var(--brand-mark-size, 24px);
+  width: auto;
+  flex: none;
+}
+
 .page {
   max-width: var(--page-width);
   margin: 0 auto;
@@ -111,6 +126,17 @@ code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em
 .stack > * + * { margin-top: var(--sp-6); }
 .stack-tight > * + * { margin-top: var(--sp-2); }
 .prose { max-width: var(--measure); }
+
+/* The landing page's masthead: mark and wordmark on one line. Baselines do not
+ * help here — the mark is a picture, not a glyph — so the two are centred on
+ * each other instead. */
+.site-brand {
+  --brand-mark-size: 52px;
+  display: flex;
+  align-items: center;
+  gap: var(--sp-3);
+}
+.site-brand > h1 { margin: 0; }
 .muted { color: var(--pkv-color-muted); }
 
 /* Card treatment is one token expanding into three properties, so `plain`
@@ -419,6 +445,8 @@ a.pkvb:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
   flex-wrap: wrap;
 }
 .mg-brand {
+  --brand-mark-size: 22px;
+  display: inline-flex; align-items: center; gap: var(--mg-2);
   font-family: var(--mg-font-title);
   font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
   text-decoration: none; color: var(--mg-ink);
diff --git a/apps/web/src/app/login/page.tsx b/apps/web/src/app/login/page.tsx
index c8861ed..bc3a3c5 100644
--- a/apps/web/src/app/login/page.tsx
+++ b/apps/web/src/app/login/page.tsx
@@ -1,6 +1,7 @@
 import type { Metadata } from "next";
 import { Discord, ExclamationTriangle } from "react-bootstrap-icons";
 import { webConfig } from "@/lib/config.ts";
+import { Logo } from "@/components/Logo.tsx";
 
 export const metadata: Metadata = { title: "Sign in", robots: { index: false, follow: false } };
 
@@ -40,7 +41,10 @@ export default async function LoginPage({
   return (
     <div className="mg">
       <header className="mg-bar">
-        <span className="mg-brand">pkviewer</span>
+        <span className="mg-brand">
+          <Logo />
+          pkviewer
+        </span>
         <span className="mg-bar-note">Sign in</span>
         <span className="spacer" />
         <a className="btn" href={webConfig.publicOrigin}>Public site</a>
diff --git a/apps/web/src/app/manage/layout.tsx b/apps/web/src/app/manage/layout.tsx
index 6a107b0..e1782a4 100644
--- a/apps/web/src/app/manage/layout.tsx
+++ b/apps/web/src/app/manage/layout.tsx
@@ -3,6 +3,7 @@ import { redirect } from "next/navigation";
 import { BoxArrowUpRight } from "react-bootstrap-icons";
 import { isAuthenticated, isPlatformAdmin } from "@/lib/manage-api.ts";
 import { webConfig } from "@/lib/config.ts";
+import { Logo } from "@/components/Logo.tsx";
 
 export const metadata: Metadata = {
   title: { default: "Manage", template: "%s · Manage · pkviewer" },
@@ -28,7 +29,10 @@ export default async function ManageLayout({ children }: { children: React.React
   return (
     <div className="mg">
       <header className="mg-bar">
-        <a className="mg-brand" href="/manage">pkviewer</a>
+        <a className="mg-brand" href="/manage">
+          <Logo />
+          pkviewer
+        </a>
         <span className="mg-bar-note">Management</span>
         <span className="spacer" />
         {admin ? <a className="btn" href="/admin">Admin</a> : null}
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index 495fc57..e831cdd 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -1,4 +1,5 @@
 import { ArrowRight, BoxArrowUpRight } from "react-bootstrap-icons";
+import { Logo } from "@/components/Logo.tsx";
 import { SiteDisclosure } from "@/components/Notices.tsx";
 import { webConfig } from "@/lib/config.ts";
 
@@ -27,7 +28,10 @@ export default function LandingPage() {
   return (
     <main className="page stack">
       <header className="stack-tight">
-        <h1>pkviewer</h1>
+        <div className="site-brand">
+          <Logo />
+          <h1>pkviewer</h1>
+        </div>
         <p className="prose">
           PluralKit handles the identity and the data. pkviewer handles how that
           identity is presented on the web.
diff --git a/apps/web/src/components/Logo.tsx b/apps/web/src/components/Logo.tsx
new file mode 100644
index 0000000..104aae6
--- /dev/null
+++ b/apps/web/src/components/Logo.tsx
@@ -0,0 +1,30 @@
+/**
+ * The pkviewer logo mark.
+ *
+ * Served from `/icon.svg`, the same file the favicon and share card are built
+ * from, rather than inlined: the artwork is 79KB of path data, which is a fine
+ * size for one immutably-cached request and a terrible one to repeat in the
+ * HTML of every page.
+ *
+ * There is deliberately no `public` directory in this project, so the app
+ * router's icon convention is also the only same-origin path this file has.
+ *
+ * Always decorative. Every placement sits the mark directly beside the word
+ * "pkviewer", so giving it alt text would make a screen reader announce the
+ * name twice. The size comes from `--brand-mark-size` on the parent, which is
+ * what lets one rule serve both the public pages and the control plane.
+ */
+export function Logo() {
+  return (
+    <img
+      className="brand-mark"
+      src="/icon.svg"
+      alt=""
+      aria-hidden="true"
+      // Intrinsic dimensions, so the box is reserved at the right ratio before
+      // the SVG loads. The rendered size is CSS's business, not theirs.
+      width={788}
+      height={659}
+    />
+  );
+}