hive-c0re: swagger theme follows stylix via colors.css, not a hardcoded copy

Loads the dashboard's own themed /static/colors.css directly (same
origin, see vhosts.nix dashboardProxyLocation) instead of redeclaring
the Catppuccin Mocha hex values locally. The theme now re-themes live
with the rest of the dashboard instead of drifting out of sync.

Addresses review feedback on PR.
This commit is contained in:
iris 2026-08-02 19:55:10 +02:00 committed by mara
commit 062a84378d
2 changed files with 68 additions and 71 deletions

View file

@ -2,10 +2,16 @@
<!-- Overrides the vendored Swagger UI's own `dist/index.html` (byte-for-
byte identical otherwise — copied from utoipa-swagger-ui-vendored
0.1.2's swagger-ui-5.17.14/dist/index.html) via the crate's
`SWAGGER_UI_OVERWRITE_FOLDER` build-time hook, adding exactly one
line: the hyperhive-theme.css stylesheet link, loaded after
swagger-ui.css so its rules win the cascade without needing
`!important`. See docs/web-ui/dashboard.md::Dashboard endpoints. -->
`SWAGGER_UI_OVERWRITE_FOLDER` build-time hook, adding two lines: the
dashboard's own themed `colors.css` (same absolute `/static/`
origin the dashboard dist serves it from — see
nix/host-modules/hive-gateway/vhosts.nix's dashboardProxyLocation,
`/` and `/api/` share one vhost so this resolves whatever the
operator's stylix theme currently renders, not a frozen copy) and
hyperhive-theme.css, which consumes those `--baseNN` vars. Loaded
after swagger-ui.css so hyperhive-theme.css's rules win the cascade
without needing `!important`. See
docs/web-ui/dashboard.md::Dashboard endpoints. -->
<!DOCTYPE html>
<html lang="en">
<head>
@ -13,6 +19,7 @@
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="stylesheet" type="text/css" href="/static/colors.css" />
<link rel="stylesheet" type="text/css" href="hyperhive-theme.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />