Introduce the `qbz-theme` crate (ADR-006): pure Rust, no Slint/Tauri/heavy deps, hand-rolled color + contrast math. It holds the scalable theming data model the Slint migration consumes. - `Rgba` + WCAG relative-luminance/contrast-ratio + an APCA Lc approximation (secondary a11y gate for P3 tests). - `ThemeColors`: the complete token contract (surfaces incl. bg-hover, text, accent, danger/warning/success families, border-subtle/muted/strong, focus-ring, favorite, card-shadow, 24-tier alpha superset with polarity baked in). - `ThemeId` enum (all 33 themes) with stable slugs, display names (proper-noun data, not i18n keys), Core/Dark/Light/Accessibility categories, and a luminance-derived light/dark flag. `default_theme_id()` = OLED. - Registry materializes the 4 P1 themes (Dark/OLED/Tokyo Night/System-fallback) from src/app.css, preserving the legacy translucent alias values so the existing themes stay pixel-identical; derives the new token families. - 22 unit tests (registry fully populated, default is OLED, legacy alpha aliases unchanged, slug roundtrip). cc
15 lines
468 B
TOML
15 lines
468 B
TOML
[package]
|
|
name = "qbz-theme"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
description = "Frontend-agnostic theme/palette registry for QBZ (ADR-006). No Slint, no Tauri, no heavy deps."
|
|
|
|
[dependencies]
|
|
# Serde only — for persisting/parsing the stable theme slug. No color/UI deps:
|
|
# all color + contrast math is hand-rolled so this crate stays light and fast.
|
|
serde = { workspace = true }
|
|
|
|
[dev-dependencies]
|