Skip to content

Theme the Payload admin and self-host fonts - #316

Merged
danielchen06 merged 2 commits into
mainfrom
feature/admin-theme
Oct 12, 2026
Merged

danielchen06 merged 2 commits into
mainfrom
feature/admin-theme

Conversation

@yrska

@yrska yrska commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

🌟 Context

The Payload admin still looked like stock Payload: grey, Payload-branded, and with every collection and global in one flat list. This restyles it with the public site's palette and makes it easier for committee members who are not technical to find and edit things.

No linked issue.


📝 Description

  • Theme (src/app/(payload)/custom.scss): the site palette (abyss, cream, grass, algae, water, seafoam) mapped onto Payload's own CSS variables, plus Rubik/Unbounded. Dark abyss sidebar like the site header, cream pages, green main actions.

  • Branding: AUCC logo on the login screen and in the nav (src/components/admin/AdminLogo.tsx, AdminIcon.tsx); page titles end in "AUCC Admin".

  • Welcome panel on the dashboard (WelcomePanel.tsx): shortcuts to Add an event, Write a trip report, Add gallery photos and Review swims, a one-line explanation of each section, and a link to the website.

  • Navigation groups: Club Content, Photos & Videos, Admin Accounts, Website Pages. Collections are reordered in payload.config.ts so everyday content comes first.

  • Usability: larger green Create New and Save buttons, darker labels and column headings, a visible box around rich text areas, clear focus rings.

  • The admin is locked to one light theme (admin.theme: 'light'), so Payload's dark mode toggle is gone.

  • Self-hosted fonts (src/app/fonts.ts): the Google Fonts @import in the public and admin stylesheets is replaced with next/font, so Rubik, Rubik Mono One, Caveat and Unbounded are served by the app. The generated family names are set as --font-face-* variables on :root from the root layout and mapped onto the existing --font-* tokens, so no component changes. Storybook has no root layout, so .storybook/preview-head.html loads the fonts directly.

No migration. The changes are admin config and CSS only; payload migrate:create --skip-empty on this branch produced nothing.


📋 Notes

  • Light theme only is a deliberate choice so everyone sees the same thing. Easy to revert if dark mode is wanted.
  • Group names and the four shortcuts are guesses at what the committee does most. They live in WelcomePanel.tsx and the admin.group line of each collection/global.
  • Body background reset: src/app/layout.tsx wraps Payload's own layout, so the public stylesheet (including the abyss body background) loads inside the admin, and admin pages log hydration errors about nested html/body. That is already the case on main. This PR only resets the background under html[data-theme]; the layout itself is untouched.
  • When the membership PR (Vvd61 membership #313) lands, its global needs admin: { group: 'Website Pages' } to sit with the other pages.
  • Fonts affect the public site too, not just the admin. A production build serves 24 self-hosted woff2 files and makes no request to Google; the built CSS keeps the var(--font-face-…) references. In next dev --turbopack an already-running server kept serving the old plain font names until restarted.
  • Testing: unit tests (including a new WelcomePanel test), lint and pnpm build pass. Checked in the browser: login, dashboard, events list, create-event form, open sidebar. The phone-width dashboard has no horizontal overflow, but I did not get a screenshot of it.

🤖 Generated with Claude Code

- Restyle the admin with the public site's palette and Rubik/Unbounded
  fonts: abyss sidebar, cream pages, green main actions.
- Lock the admin to one light theme so everyone sees the same thing.
- AUCC logo on the login screen and in the nav; page titles end in
  "AUCC Admin" instead of "Payload".
- Welcome panel on the dashboard with shortcuts to the everyday tasks
  and a one-line explanation of each section.
- Group the navigation into Club Content, Photos & Videos, Website
  Pages and Admin Accounts, everyday content first.
- Usability: prominent Create New and Save buttons, readable labels and
  column headings, outlined rich text areas, visible focus rings.

The root layout loads the public stylesheet into the admin as well, so
the body background is reset under html[data-theme].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
aucc Ready Ready Preview Oct 12, 2026 11:54am UTC

Replace the Google Fonts @import in the public and admin stylesheets
with next/font, so Rubik, Rubik Mono One, Caveat and Unbounded are
served from the app instead of fetched from Google at page load.

The generated family names are exposed as --font-face-* variables from
the root layout, and both stylesheets map them onto the existing
--font-* tokens. They are set on :root from a hoisted <style> rather
than a class on <html>, because the Payload admin renders its own
<html>. Storybook has no root layout, so it loads the fonts directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yrska yrska changed the title Theme the Payload admin to match the site Theme the Payload admin and self-host fonts Oct 12, 2026
@danielchen06
danielchen06 merged commit cb2928a into main Oct 12, 2026
6 of 7 checks passed
@danielchen06
danielchen06 deleted the feature/admin-theme branch October 12, 2026 12:17
@github-actions

Copy link
Copy Markdown

🚀 Preview deployment is live: Preview Link

This branch was successfully deployed

1 active deployment
Preview — fcb3343b Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants