Skip to main content

parse_stylesheet

Function parse_stylesheet 

Source
pub fn parse_stylesheet(yaml: &str) -> Result<ThemeVariants, StylesheetError>
Expand description

Parses a YAML stylesheet and builds theme variants.

§Arguments

  • yaml - YAML content as a string

§Returns

A ThemeVariants containing base, light, and dark style maps.

§Errors

Returns StylesheetError if:

  • YAML parsing fails
  • Style definitions are invalid
  • Colors or attributes are unrecognized

§Example

use standout_render::style::parse_stylesheet;

let yaml = r#"
header:
  fg: cyan
  bold: true

muted:
  dim: true

footer:
  fg: gray
  light:
    fg: black
  dark:
    fg: white

disabled: muted
"#;

let variants = parse_stylesheet(yaml).unwrap();