Skip to main content

load_token_file

Function load_token_file 

Source
pub fn load_token_file(path: &Path) -> Result<TokenFile, TokenError>
Expand description

Load a multi-theme token file.

Expects either:

  • { "themes": { "light": { ... }, "dark": { ... } } } (multi-theme)
  • { "token-name": "value", ... } (flat — treated as a single "default" theme)

§Errors

Returns TokenError::Io if the file cannot be read, TokenError::InvalidJson if parsing fails, or TokenError::Schema if the structure is invalid.