Files

162 lines
7.2 KiB
Markdown

# YoRHa for Gitea
A custom Gitea interface drawn from my Hyprland and Quickshell setup.
Two palettes share one interface: **YoRHa Dark** uses my desktop's green-black
hull, sage text, and pale selection blocks; **YoRHa Light** uses Automata-inspired
sand, paper, and graphite. Both keep muted semantic colors for syntax, diffs,
and status. Built and verified against **Gitea 28.3.0**.
![YoRHa Light repository](docs/light-repository.png)
![YoRHa Dark profile](docs/dark-profile.png)
## Interface
- A continuous desktop navigation rail with an original geometric crest.
- Larger repository titles and inverted active tabs, like the NieR cursor.
- Framed file panels, double-rule dividers, and explicit keyboard focus.
- Ruled repository records, portrait identity plates, and structured issue filters.
- Redesigned histories, pagination, settings menus, alerts, tables, and dialogs.
- Contrast-aware checkboxes, status labels, actions, and form states.
- Locally hosted Noto Sans and JetBrains Mono variable fonts.
- Native Gitea menus, forms, code navigation, semantic labels, and diff colors.
- Native top navigation below 1280px wide or 600px tall; mobile layouts down to 320px.
The dark palette comes from `~/.config/quickshell/config/Theme.qml` and
`~/.config/hypr/lua/palette.lua`. The light palette is inspired by the game's
menus and [PlatinumGames' UI design notes](https://www.platinumgames.com/official-blog/article/9624):
| Role | Light | Dark |
| --- | --- | --- |
| Ground | `#cdc8b0` | `#0f110e` |
| Panel | `#dad5bd` | `#161915` |
| Header / rail | `#c5c0a8` | `#0c0d0b` |
| Text | `#454138` | `#ccd2cb` |
| Cursor | `#454138` | `#eef1ea` |
| Alarm | `#843724` | `#c8684f` |
The deployed theme has no external font services, custom JavaScript, template
overrides, wallpapers, or runtime build dependencies. The development-only
component preview uses a small script to choose its stylesheet.
## Files
| Path | Purpose |
| --- | --- |
| `css/theme-yorha-{dark,light}.css` | Two selectable theme entrypoints |
| `css/yorha/gitea-{dark,light}.css` | Matching Gitea foundations, vendored because built-in asset names are fingerprinted |
| `css/yorha/{palette,palette-light}.css` | Separate complete palettes, syntax, diffs, and semantic colors |
| `css/yorha/fonts.css` | Shared local font declarations |
| `css/yorha/{controls,interface,components}.css` | Shared controls, shell, and component layouts |
| `preview/components.html` | Development-only settings, forms, feedback, tables, and dialog gallery |
| `fonts/yorha/` | Latin variable fonts and their OFL licenses; system fallback covers other scripts |
| `scripts/` | Visual verification, deployment, and rollback |
Change `--yorha-wordmark` in `interface.css` to customize the `NVRLGIT` wordmark.
Change the version query on the imports after editing CSS for a release.
## Installation
Copy `css/` and `fonts/` into `${GITEA_CUSTOM}/public/assets/`. Append
both `yorha-dark` and `yorha-light` to the existing `[ui] THEMES` list.
Use `DEFAULT_THEME = yorha-dark` or `DEFAULT_THEME = yorha-light` for the
server default. Preserve the other theme names. My server keeps Dark as default.
Restart Gitea once after changing configuration. Subsequent CSS updates need
a hard browser refresh if an old asset is cached. Gitea caches theme names
and color-scheme metadata; restart after changing those entrypoint declarations.
Existing accounts keep their saved theme preference. Select **YoRHa Dark**
or **YoRHa Light** in the footer theme menu to switch explicitly.
## Local checks
Node is needed only for the development checks:
```sh
npm ci
npx playwright install chromium
npm run verify
# Or use a locally installed Chromium:
CHROMIUM_PATH=/usr/bin/chromium npm run verify
```
The check intercepts theme asset requests with local files while loading the
real public Gitea pages. It checks 15 page/viewport combinations for each
palette: repository, code, diff, login, profile, explore, history, mobile,
short-height layouts, and the component gallery. It verifies local font
loading, page overflow, menu behavior, keyboard focus, checkbox ticks, and
rendered text contrast for forms, actions, labels, feedback, and dialog headings.
It never signs in or submits a form. Screenshots and the JSON report
go into ignored `artifacts/preview/`. Review screenshots as well as assertions.
```sh
LIVE=1 CHROMIUM_PATH=/usr/bin/chromium npm run verify
```
This second command tests deployed assets without interception, checks that
Dark remains the default, and verifies that the native footer switcher can
select and persist both themes. The component gallery is injected only into
the test browser and is never deployed. `GITEA_URL`
can change the origin; edit the public repository paths in `scripts/verify.cjs`
if using another server. Account menus and administration screens still need
an authenticated manual check when changing their layout. The gallery covers
component styling; it does not exercise an authenticated settings backend.
For a local interactive gallery, serve the repository root:
```sh
python3 -m http.server 4178 --bind 127.0.0.1
# http://127.0.0.1:4178/preview/components.html?theme=light
# http://127.0.0.1:4178/preview/components.html?theme=dark
```
The gallery loads the matching Gitea core CSS from my public instance. Theme
CSS and fonts come from the local project.
## Deploy to my server
```sh
bash scripts/deploy.sh
```
Defaults: `narl@narl.io`, SSH port `420`, asset directory
`/opt/gitea/gitea/gitea/public/assets`. Override `SSH_HOST`, `SSH_PORT`,
`ASSET_DIR`, or `BACKUP_DIR` as needed. No password is stored in this project.
After deploying the new Light theme for the first time, register it and restart:
```sh
ssh -p 420 narl@narl.io 'python3 - /opt/gitea/gitea/gitea/conf/app.ini /opt/gitea/theme-backups' < scripts/register-themes.py
ssh -p 420 narl@narl.io 'docker restart --time 30 gitea'
```
The registration helper handles duplicate `[ui]` sections, preserves the current
default and all unrelated settings, and saves a private configuration backup.
Run it after assets exist. It is safe to repeat.
The deployment script backs up overwritten theme files into a timestamped directory
under `/opt/gitea/theme-backups`, records newly created files in a manifest,
and publishes CSS dependencies before the theme entrypoint. It does not read
or change `app.ini` and does not restart Gitea. Preserve its printed backup path.
To roll back a deployment, run the included helper remotely with that path:
```sh
ssh -p 420 narl@narl.io 'python3 - /opt/gitea/theme-backups/REVISION' < scripts/rollback.py
```
The original default-theme configuration backup is
`/opt/gitea/theme-backups/20261105T091454Z/app.ini`. It contains server secrets
and is deliberately excluded from this project. To change the default back,
restore only the original `[ui]` theme settings and restart Gitea.
## Gitea upgrades
The palette and interface use Gitea's component selectors. After upgrading,
refresh both vendored foundations from the matching installed Gitea version,
review new color tokens, run the visual checks, and inspect authenticated
settings and menus before deployment. Keep `GITEA-LICENSE.txt` alongside it.
Custom CSS is MIT licensed. The vendored foundation retains Gitea's MIT
license; the two font families retain their bundled OFL licenses.