Skip to main content

Module style

Module style 

Source
Expand description

Shared Style Constants for TUI/WASM Parity

This module provides unified color and style constants to ensure visual consistency between TUI (ratatui) and WASM (Canvas/CSS) renders.

§Architecture (OR-001 Compliant)

All visual constants are defined ONCE here and used by both:

  • TUI: via ratatui::style::Color conversions
  • WASM: via CSS variable injection / Canvas fill styles

§References

  • WCAG 2.1 AA contrast requirements
  • TPS Visual Control (見える化)

Constants§

ACCENT
Accent color (teal/cyan) - success, highlights
ACCENT_ERROR
Error color (red/coral)
ACCENT_WARN
Warning color (yellow/gold)
BG_PRIMARY
Primary background color (darkest)
BG_SECONDARY
Secondary background color (panels)
BG_TERTIARY
Tertiary background color (canvas/content)
BORDER
Primary border color
CITY_NODE
City node color (yellow dots on map)
FONT_MONO
Font family for monospace text
FONT_SIZE_BASE
Font size base (rem)
FONT_SIZE_SMALL
Font size small (rem)
PROBAR
Probar brand color (testing indicator)
TEXT_PRIMARY
Primary text color (high contrast)
TEXT_SECONDARY
Secondary text color (labels, muted)
TOUR_PATH
Tour path color (teal lines)

Functions§

css_variables
Generate CSS custom properties string for injection
hex_to_rgb
Parse hex color to RGB tuple