use ratatui_core::style::Style;
pub trait StyleSheet: Clone + Send + Sync + 'static {
fn heading(&self, level: u8) -> Style;
fn code(&self) -> Style;
fn link(&self) -> Style;
fn blockquote(&self) -> Style;
fn heading_meta(&self) -> Style;
fn metadata_block(&self) -> Style;
}
#[derive(Clone, Copy, Debug, Default)]
pub struct DefaultStyleSheet;
impl StyleSheet for DefaultStyleSheet {
fn heading(&self, level: u8) -> Style {
match level {
1 => Style::new().on_cyan().bold().underlined(),
2 => Style::new().cyan().bold(),
3 => Style::new().cyan().bold().italic(),
4 => Style::new().light_cyan().italic(),
5 => Style::new().light_cyan().italic(),
_ => Style::new().light_cyan().italic(),
}
}
fn code(&self) -> Style {
Style::new().white().on_black()
}
fn link(&self) -> Style {
Style::new().blue().underlined()
}
fn blockquote(&self) -> Style {
Style::new().green()
}
fn heading_meta(&self) -> Style {
Style::new().dim()
}
fn metadata_block(&self) -> Style {
Style::new().light_yellow()
}
}