#![allow(clippy::many_single_char_names, clippy::unreadable_literal)]
use serde::Serialize;
use std::collections::HashMap;
mod ansi;
mod color;
mod dirs;
mod emphasis;
mod font;
mod intent;
mod load;
mod selection;
mod sheet;
mod typography;
#[cfg(test)]
pub(crate) mod fixture;
pub use ansi::{
ANSI_16, ANSI_240, ANSI_240_OFFSET, ANSI_256, DISTINCT, ansi_intent, quantize, quantize_against,
};
pub use color::{Oklab, Rgb, darken, lighten, mix, readable_on, wcag_contrast};
pub use dirs::{ThemeDirs, bundled_themes_dir, embedded_themes, find_theme_path};
pub use emphasis::{Emphasis, STEP_FLOOR, emphasized, tonal};
pub use font::{FontFace, FontOverride, FontSlot, Typography};
pub use intent::{BASE_INTENTS, SemanticTokens, intent_css_declarations, intent_css_vars, resolve};
pub use load::{
ThemePreview, delete_theme, derive_tonal_steps, export_theme, extract_colors, import_theme,
list_themes_from_dirs, load_semantic, load_theme, load_theme_preview, parse_meta,
parse_theme_str, validate_theme_id,
};
pub use selection::{
ContrastTier, FOLLOW, ThemeDefaults, ThemeOption, ThemeSelection, Variant, order_theme_options,
theme_options,
};
pub use sheet::{THEME_ATTRIBUTE, all_themes_css, keyed_intent_css_vars};
pub use typography::{
FONT_MONO, FONT_SANS, HOUSE_MONO_FAMILY, HOUSE_SANS_FAMILY, HOUSE_WEIGHT_RANGE,
WEBFONT_MONO_FILE, WEBFONT_SANS_FILE, font_face_css, typography_css_declarations,
typography_css_vars,
};
pub const COLOR_SECTIONS: &[&str] = &["surface", "content", "action", "status", "line", "category"];
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ThemeMeta {
pub id: String,
pub name: String,
pub variant: String,
pub is_custom: bool,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ThemeColors {
pub meta: ThemeMeta,
pub colors: HashMap<String, String>,
}
#[cfg(test)]
mod tests {
#[allow(unused_imports)]
use crate::{
ANSI_16, ANSI_240, ANSI_240_OFFSET, ANSI_256, BASE_INTENTS, COLOR_SECTIONS, ContrastTier,
DISTINCT, Emphasis, FOLLOW, FONT_MONO, FONT_SANS, FontFace, FontOverride, FontSlot,
HOUSE_MONO_FAMILY, HOUSE_SANS_FAMILY, HOUSE_WEIGHT_RANGE, Oklab, Rgb, STEP_FLOOR,
SemanticTokens, THEME_ATTRIBUTE, ThemeColors, ThemeDefaults, ThemeDirs, ThemeMeta,
ThemeOption, ThemePreview, ThemeSelection, Typography, Variant, WEBFONT_MONO_FILE,
WEBFONT_SANS_FILE, all_themes_css, ansi_intent, bundled_themes_dir, darken, delete_theme,
derive_tonal_steps, embedded_themes, emphasized, export_theme, extract_colors,
find_theme_path, font_face_css, import_theme, intent_css_declarations, intent_css_vars,
keyed_intent_css_vars, lighten, list_themes_from_dirs, load_semantic, load_theme,
load_theme_preview, mix, order_theme_options, parse_meta, parse_theme_str, quantize,
quantize_against, readable_on, resolve, theme_options, tonal, typography_css_declarations,
typography_css_vars, validate_theme_id, wcag_contrast,
};
}