Files
gitea-custom/AGENTS.md
T
cole-maxwell1 b21d961929 fix(theme): switch navbar and home logos through pure css
Extend theme-aware logo switching to the home page hero logo, which previously never changed with the active color scheme, and keep the navbar logo switching in the same CSS-only mechanism.

Replace the header template synchronization script with theme CSS background images so logos render correctly at first paint, work with JavaScript disabled, and avoid WebKit replaced-element repaint behavior. Hide the upstream images as layout placeholders and use selectors that outrank Gitea's navbar hover styles.

Add an AGENTS.md guide documenting repository scope, theme and template constraints, verification expectations, and the manual deployment flow.
2026-09-07 21:57:59 -05:00

2.0 KiB

Repository Guide

Scope

  • This repository is a static overlay copied into Gitea's custom path; it has no local build, lint, or automated test toolchain.
  • Target Gitea 1.27.x. Treat upstream theme variables and template structure as version-coupled behavior.

Themes

  • theme-codecraftsmen-light.css and theme-codecraftsmen-dark.css intentionally import Gitea-provided theme-gitea-*.css files that are absent from this repository.
  • Keep custom themes as overrides of upstream themes so newly added Gitea defaults continue to apply.
  • theme-codecraftsmen-auto.css selects the custom light and dark themes with prefers-color-scheme; verify changes in all three theme modes.
  • Keep font and image URLs relative to public/assets/css/ (../fonts/... and ../img/...) because Gitea serves these files below /assets/.
  • Preserve gitea-theme-meta-info, including both display name and color scheme, so Gitea can discover each theme correctly.
  • Do not add overrides under templates/base/ for branding. Replace the upstream navbar and home page logo images through theme CSS so Gitea template upgrades remain intact.

Templates

  • templates/custom/header.tmpl injects Plausible analytics. Every external or inline script must use nonce="{{ctx.CspScriptNonce}}" or Gitea's CSP will block it.

Verification And Deployment

  • There is no standalone local renderer. Validate on the target Gitea release across anonymous, authenticated, and administrator pages in light, dark, and auto modes.
  • For Gitea upgrades, compare both custom palettes against the built-in light and dark themes from the exact target release before testing.
  • Deployment is not automated here. After review, synchronize public/ and templates/ to ansible/roles/gitea/files/theme in the separate homelab repository.

Assets

  • The bundled fonts and logos are project-supplied and do not grant redistribution rights; do not publish or replace them without confirming the applicable licenses.