refactor(cli): extract the shared shell stylesheet into assets/aura.css
Pure byte-preserving extraction: the CSS block inside SHELL_HEAD moves verbatim into crates/aura-cli/assets/aura.css and is spliced back via concat!(.., include_str!(..), ..). Proven against a pre-change baseline: chart HTML (aura chart 42edebd2-0/597d719b-GER40-w0) and graph HTML (bare aura graph) regenerate sha256-identical (bcc2cc0f.., a0e6a97f..), each deterministic across two generations. Suite 1043/0. First half of the style pin: the asset becomes the single source the runtime pages embed; tokens + component library follow separately. refs #209
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
html, body { margin: 0; height: 100%; background: #16161a; color: #cdd6f4;
|
||||
font-family: ui-monospace, monospace; }
|
||||
header { padding: 8px 14px; border-bottom: 1px solid #313244; font-size: 13px;
|
||||
display: flex; gap: 16px; align-items: baseline; flex-wrap: nowrap;
|
||||
white-space: nowrap; overflow: hidden; }
|
||||
header b { color: #f5e0dc; } .sub { color: #6c7086; }
|
||||
#crumb a { color: #89b4fa; cursor: pointer; text-decoration: none; }
|
||||
#crumb a:hover { text-decoration: underline; }
|
||||
#crumb .sep { color: #6c7086; }
|
||||
#status { color: #6c7086; margin-left: auto; }
|
||||
#stage { width: 100%; height: calc(100% - 44px); }
|
||||
#stage svg { width: 100%; height: 100%; cursor: default; }
|
||||
#stage svg text { cursor: inherit; user-select: none; -webkit-user-select: none; }
|
||||
#stage svg a { cursor: inherit; }
|
||||
#err { padding: 14px; color: #f38ba8; white-space: pre-wrap; }
|
||||
#tip { position: fixed; display: none; pointer-events: none; z-index: 10;
|
||||
background: #1e1e2e; border: 1px solid #585b70; border-radius: 6px; padding: 6px 9px;
|
||||
font-family: ui-monospace, monospace; font-size: 12px; color: #cdd6f4;
|
||||
max-width: 420px; box-shadow: 0 6px 18px rgba(0,0,0,.55); line-height: 1.5; }
|
||||
#tip b { color: #f5e0dc; } #tip code { color: #89b4fa; } #tip .dim { color: #7f849c; }
|
||||
@@ -13,38 +13,23 @@ use aura_engine::Composite;
|
||||
/// (`docs/design/prototypes/graph-render/index.html` lines 1-38), minus the two
|
||||
/// `<script src="./…">` tags (the assets are inlined). The `{title}` placeholder
|
||||
/// and the per-page `<header>` let one shell serve both the graph and the chart
|
||||
/// page without one borrowing the other's label.
|
||||
const SHELL_HEAD: &str = r#"<!doctype html>
|
||||
/// page without one borrowing the other's label. The shared stylesheet body now
|
||||
/// lives in `assets/aura.css` and is spliced back in verbatim via `include_str!`.
|
||||
const SHELL_HEAD: &str = concat!(
|
||||
r#"<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{title}</title>
|
||||
<style>
|
||||
html, body { margin: 0; height: 100%; background: #16161a; color: #cdd6f4;
|
||||
font-family: ui-monospace, monospace; }
|
||||
header { padding: 8px 14px; border-bottom: 1px solid #313244; font-size: 13px;
|
||||
display: flex; gap: 16px; align-items: baseline; flex-wrap: nowrap;
|
||||
white-space: nowrap; overflow: hidden; }
|
||||
header b { color: #f5e0dc; } .sub { color: #6c7086; }
|
||||
#crumb a { color: #89b4fa; cursor: pointer; text-decoration: none; }
|
||||
#crumb a:hover { text-decoration: underline; }
|
||||
#crumb .sep { color: #6c7086; }
|
||||
#status { color: #6c7086; margin-left: auto; }
|
||||
#stage { width: 100%; height: calc(100% - 44px); }
|
||||
#stage svg { width: 100%; height: 100%; cursor: default; }
|
||||
#stage svg text { cursor: inherit; user-select: none; -webkit-user-select: none; }
|
||||
#stage svg a { cursor: inherit; }
|
||||
#err { padding: 14px; color: #f38ba8; white-space: pre-wrap; }
|
||||
#tip { position: fixed; display: none; pointer-events: none; z-index: 10;
|
||||
background: #1e1e2e; border: 1px solid #585b70; border-radius: 6px; padding: 6px 9px;
|
||||
font-family: ui-monospace, monospace; font-size: 12px; color: #cdd6f4;
|
||||
max-width: 420px; box-shadow: 0 6px 18px rgba(0,0,0,.55); line-height: 1.5; }
|
||||
#tip b { color: #f5e0dc; } #tip code { color: #89b4fa; } #tip .dim { color: #7f849c; }
|
||||
</style>
|
||||
"#,
|
||||
include_str!("../assets/aura.css"),
|
||||
r#"</style>
|
||||
</head>
|
||||
<body>
|
||||
"#;
|
||||
"#
|
||||
);
|
||||
|
||||
/// The graph page's `<title>` text and `<header>` line (hover/expand/drill hint),
|
||||
/// graph-specific — split out of the shared shell.
|
||||
|
||||
Reference in New Issue
Block a user