css: route palette + body typography through hive-fr0nt::BASE_CSS
This commit is contained in:
parent
7fc3e81062
commit
e283e39949
7 changed files with 28 additions and 43 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
|
@ -451,6 +451,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"axum",
|
||||
"clap",
|
||||
"hive-fr0nt",
|
||||
"hive-sh4re",
|
||||
"rmcp",
|
||||
"rusqlite",
|
||||
|
|
@ -470,6 +471,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"axum",
|
||||
"clap",
|
||||
"hive-fr0nt",
|
||||
"hive-sh4re",
|
||||
"libc",
|
||||
"rusqlite",
|
||||
|
|
@ -481,6 +483,10 @@ dependencies = [
|
|||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hive-fr0nt"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "hive-sh4re"
|
||||
version = "0.1.0"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ workspace = true
|
|||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
clap.workspace = true
|
||||
hive-fr0nt.workspace = true
|
||||
hive-sh4re.workspace = true
|
||||
rmcp.workspace = true
|
||||
rusqlite.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,24 +1,9 @@
|
|||
:root {
|
||||
/* Catppuccin Mocha — mirrors the dashboard palette. */
|
||||
--bg: #1e1e2e; /* base */
|
||||
--bg-elev: #181825; /* mantle */
|
||||
--fg: #cdd6f4; /* text */
|
||||
--muted: #7f849c; /* overlay1 */
|
||||
--purple: #cba6f7; /* mauve */
|
||||
--purple-dim: #45475a; /* surface1 */
|
||||
--cyan: #89dceb; /* sky */
|
||||
--amber: #fab387; /* peach */
|
||||
--green: #a6e3a1; /* green */
|
||||
--red: #f38ba8; /* red */
|
||||
}
|
||||
/* Palette + base body typography live in hive-fr0nt::BASE_CSS, prepended
|
||||
to this stylesheet by `serve_css` at runtime. */
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", "Source Code Pro", monospace;
|
||||
max-width: 110em;
|
||||
margin: 1.5em auto;
|
||||
padding: 0 1.5em;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.banner {
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -162,10 +162,15 @@ async fn serve_index() -> impl IntoResponse {
|
|||
}
|
||||
|
||||
async fn serve_css() -> impl IntoResponse {
|
||||
(
|
||||
[("content-type", "text/css")],
|
||||
// Prepend the shared palette/typography so per-page styles only need
|
||||
// to declare what's actually page-specific. One HTTP request, no
|
||||
// per-asset cache to invalidate.
|
||||
let body = format!(
|
||||
"{}\n{}",
|
||||
hive_fr0nt::BASE_CSS,
|
||||
include_str!("../assets/agent.css"),
|
||||
)
|
||||
);
|
||||
([("content-type", "text/css")], body)
|
||||
}
|
||||
|
||||
async fn serve_app_js() -> impl IntoResponse {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ workspace = true
|
|||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
clap.workspace = true
|
||||
hive-fr0nt.workspace = true
|
||||
hive-sh4re.workspace = true
|
||||
libc = "0.2"
|
||||
rusqlite.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,27 +1,9 @@
|
|||
:root {
|
||||
/* Catppuccin Mocha. Keep the legacy variable names so per-class styles
|
||||
don't need to be rewritten — only the values change. */
|
||||
--bg: #1e1e2e; /* base */
|
||||
--bg-elev: #181825; /* mantle */
|
||||
--fg: #cdd6f4; /* text */
|
||||
--muted: #7f849c; /* overlay1 */
|
||||
--purple: #cba6f7; /* mauve */
|
||||
--purple-dim: #45475a; /* surface1 */
|
||||
--cyan: #89dceb; /* sky */
|
||||
--pink: #f5c2e7; /* pink */
|
||||
--amber: #fab387; /* peach */
|
||||
--green: #a6e3a1; /* green */
|
||||
--red: #f38ba8; /* red */
|
||||
--border: #313244; /* surface0 */
|
||||
}
|
||||
/* Palette + base body typography live in hive-fr0nt::BASE_CSS, prepended
|
||||
to this stylesheet by `serve_css` at runtime. */
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", "Source Code Pro", monospace;
|
||||
max-width: 70em;
|
||||
margin: 1.5em auto;
|
||||
padding: 0 1.5em;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.banner {
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -114,10 +114,15 @@ async fn serve_index() -> impl IntoResponse {
|
|||
}
|
||||
|
||||
async fn serve_css() -> impl IntoResponse {
|
||||
(
|
||||
[("content-type", "text/css")],
|
||||
// Prepend the shared palette/typography so per-page styles only need
|
||||
// to declare what's actually page-specific. One HTTP request, no
|
||||
// per-asset cache to invalidate.
|
||||
let body = format!(
|
||||
"{}\n{}",
|
||||
hive_fr0nt::BASE_CSS,
|
||||
include_str!("../assets/dashboard.css"),
|
||||
)
|
||||
);
|
||||
([("content-type", "text/css")], body)
|
||||
}
|
||||
|
||||
async fn serve_app_js() -> impl IntoResponse {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue