use crate::mdrender::Theme;
pub(crate) const INK: &str = "#0D0D0D";
pub(crate) const GRAPHITE: &str = "#2A2A2A";
pub(crate) const PAPER: &str = "#F5F5F0";
pub(crate) const SIGNAL: &str = "#B8FF00";
pub(crate) const MUTED_DARK: &str = "#a6a69c";
pub(crate) const MUTED_LIGHT: &str = "#52514e";
pub(crate) const ACCENT_DARK: &str = "#cfcfc6";
pub(crate) const PASS_DARK: &str = "#3fb950";
pub(crate) const WARN_DARK: &str = "#d29922";
pub(crate) const HOLD_DARK: &str = "#e0a92e";
pub(crate) const BLOCK_DARK: &str = "#f0655e";
pub(crate) const PASS_LIGHT: &str = "#0a7d2e";
pub(crate) const WARN_LIGHT: &str = "#8a6300";
pub(crate) const HOLD_LIGHT: &str = "#8a6300";
pub(crate) const BLOCK_LIGHT: &str = "#c0342e";
pub(crate) const FONT_HEADING: &str =
"'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif";
pub(crate) const FONT_MONO: &str =
"'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
pub(crate) fn root_css() -> String {
format!(
r#":root {{
color-scheme: dark;
--ink:{ink}; --graphite:{graphite}; --paper:{paper}; --signal:{signal};
--veil:255,255,255;
--bg:{ink}; --surface:rgba(var(--veil),0.05); --fg:{paper};
--muted:{muted_d}; --line:rgba(var(--veil),0.12); --accent:{accent_d};
--pass:{pass_d}; --warn:{warn_d}; --hold:{hold_d}; --block:{block_d};
--font-heading:{font_heading};
--mono:{font_mono};
}}
@media (prefers-color-scheme: light) {{ :root {{
color-scheme: light;
--veil:13,13,13;
--bg:{paper}; --surface:#ffffff; --fg:{ink};
--muted:{muted_l}; --line:rgba(var(--veil),0.12); --accent:{graphite};
--pass:{pass_l}; --warn:{warn_l}; --hold:{hold_l}; --block:{block_l};
}} }}
"#,
ink = INK,
graphite = GRAPHITE,
paper = PAPER,
signal = SIGNAL,
muted_d = MUTED_DARK,
muted_l = MUTED_LIGHT,
accent_d = ACCENT_DARK,
pass_d = PASS_DARK,
warn_d = WARN_DARK,
hold_d = HOLD_DARK,
block_d = BLOCK_DARK,
pass_l = PASS_LIGHT,
warn_l = WARN_LIGHT,
hold_l = HOLD_LIGHT,
block_l = BLOCK_LIGHT,
font_heading = FONT_HEADING,
font_mono = FONT_MONO,
)
}
pub(crate) fn review_theme() -> Theme {
Theme {
bg: "var(--bg)".to_string(),
surface: "var(--surface)".to_string(),
text: "var(--fg)".to_string(),
muted: "var(--muted)".to_string(),
accent: "var(--fg)".to_string(),
border: "var(--line)".to_string(),
status_note: "var(--muted)".to_string(),
status_tip: "var(--pass)".to_string(),
status_important: "var(--hold)".to_string(),
status_warning: "var(--warn)".to_string(),
status_caution: "var(--block)".to_string(),
font_heading: "var(--font-heading)".to_string(),
font_body: "inherit".to_string(),
font_mono: "var(--mono)".to_string(),
root_class: "mdr".to_string(),
code_theme: "base16-ocean.dark".to_string(),
}
}
pub(crate) fn mini_footer_html() -> String {
let sep = r#"<span style="color:var(--signal)"> · </span>"#;
format!(
r#"<footer style="margin:44px 0 8px;padding-top:18px;border-top:1px solid var(--line);text-align:center;font-family:var(--mono);font-size:11px;line-height:1.7">
<div style="color:var(--muted);letter-spacing:0.04em">pull request{sep}rust cli{sep}diff intelligence</div>
<div style="color:var(--muted);opacity:0.7;margin-top:4px">powered by prview-rs</div>
</footer>"#
)
}
pub(crate) fn dashboard_narrative_theme() -> Theme {
Theme {
bg: "var(--bg)".to_string(),
surface: "var(--surface-2)".to_string(),
text: "var(--fg)".to_string(),
muted: "var(--muted)".to_string(),
accent: "var(--accent)".to_string(),
border: "var(--line)".to_string(),
status_note: "var(--muted)".to_string(),
status_tip: "var(--pass)".to_string(),
status_important: "var(--accent)".to_string(),
status_warning: "var(--warn)".to_string(),
status_caution: "var(--block)".to_string(),
font_heading: "var(--font-heading)".to_string(),
font_body: "inherit".to_string(),
font_mono: "var(--mono)".to_string(),
root_class: "mdr".to_string(),
code_theme: "base16-ocean.dark".to_string(),
}
}