//! Built-in color themes.

use clap::ValueEnum;

/// Base stylesheet — layout, navigation, repo list, tree view, blame.
pub const BASE_CSS: &str = include_str!("../static/base.css");

/// Additional styles for rendered Markdown (README files).
pub const MARKDOWN_CSS: &str = include_str!("../static/markdown.css");

/// A built-in color theme.  `Auto` and `SolarizedAuto` follow the OS
/// light/dark preference via `prefers-color-scheme`.
#[derive(Clone, Default, ValueEnum)]
pub enum Theme {
    /// Follows the OS light/dark preference.
    #[default]
    Auto,
    Light,
    Dark,
    SolarizedAuto,
    SolarizedLight,
    SolarizedDark,
}

impl Theme {
    /// Returns the compiled CSS for this theme variant.
    pub const fn css(&self) -> &'static str {
        match self {
            Self::Auto => include_str!("../static/auto.css"),
            Self::Light => include_str!("../static/light.css"),
            Self::Dark => include_str!("../static/dark.css"),
            Self::SolarizedAuto => include_str!("../static/solarized_auto.css"),
            Self::SolarizedLight => include_str!("../static/solarized_light.css"),
            Self::SolarizedDark => include_str!("../static/solarized_dark.css"),
        }
    }
}
