Skip to main content

Module theme

Module theme 

Source
Expand description

Premium theme definitions with world-class, Stripe-level aesthetics.

Design principles:

  • Muted, sophisticated colors that are easy on the eyes
  • Clear visual hierarchy with accent colors used sparingly
  • Consistent design language across all elements
  • High contrast where it matters (text legibility)
  • Subtle agent differentiation via tinted backgrounds

Modules§

colors
Premium color palette inspired by modern design systems. Uses low-saturation colors for comfort with refined accents for highlights.

Structs§

AdaptiveBorders
Adaptive border configuration based on terminal width.
GradientShades
Gradient shades for simulating depth effects in headers/pills.
PaneTheme
RoleTheme
Complete styling for a message role (user, assistant, tool, system).
ThemePalette

Enums§

ContrastLevel
WCAG compliance level for contrast ratios.
TerminalWidth
Terminal width classification for adaptive styling.
ThemePreset
Available theme presets that users can cycle through.

Functions§

check_contrast
Check contrast compliance between foreground and background colors.
chip_style
Creates a subtle badge/chip style for filter indicators
contrast_ratio
Calculate WCAG contrast ratio between two colors. Returns a value from 1.0 (no contrast) to 21.0 (black/white).
ensure_contrast
Ensure a color meets minimum contrast against a background. If the color doesn’t meet the requirement, returns a suggested alternative.
kbd_style
Creates a keyboard shortcut style (for help text)
relative_luminance
Calculate relative luminance of an RGB color per WCAG 2.1. Returns a value from 0.0 (black) to 1.0 (white).
score_style
Creates style for score indicators based on magnitude