Documentation
¶
Overview ¶
Package theme provides a unified visual design system for terminal UIs. Inspired by Dark Elegance: rich blacks, subtle depth, glowing accents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Layout = struct { // Padding PaddingXS int PaddingSM int PaddingMD int PaddingLG int PaddingXL int // Margins MarginXS int MarginSM int MarginMD int MarginLG int MarginXL int // Component dimensions HeaderHeight int StatusHeight int InputMinHeight int PickerMaxHeight int ScrollbarWidth int }{ PaddingXS: 1, PaddingSM: 2, PaddingMD: 3, PaddingLG: 4, PaddingXL: 6, MarginXS: 1, MarginSM: 2, MarginMD: 3, MarginLG: 4, MarginXL: 6, HeaderHeight: 1, StatusHeight: 1, InputMinHeight: 3, PickerMaxHeight: 15, ScrollbarWidth: 1, }
Layout defines standard spacing and dimensions.
var Symbols = struct { // Bullets and markers Bullet string BulletEmpty string Arrow string ArrowRight string ArrowDown string Check string Cross string Dot string Ring string // Borders (rounded) BorderTopLeft string BorderTopRight string BorderBottomLeft string BorderBottomRight string BorderHorizontal string BorderVertical string // UI elements Spinner []string Progress string ProgressFill string Scrollbar string ScrollThumb string // Message prefixes User string Assistant string System string Tool string Thinking string // Mode indicators ModeNormal string ModeShell string ModeEnv string ModeSearch string // File types FileDefault string FileFolder string FileGo string FileJS string FileTS string FilePython string FileMarkdown string FileYAML string FileJSON string }{ Bullet: "●", BulletEmpty: "○", Arrow: "›", ArrowRight: "→", ArrowDown: "↓", Check: "✓", Cross: "✗", Dot: "·", Ring: "◌", BorderTopLeft: "╭", BorderTopRight: "╮", BorderBottomLeft: "╰", BorderBottomRight: "╯", BorderHorizontal: "─", BorderVertical: "│", Spinner: []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}, Progress: "░", ProgressFill: "█", Scrollbar: "░", ScrollThumb: "█", User: "❯", Assistant: "●", System: "◆", Tool: "◇", Thinking: "…", ModeNormal: "λ", ModeShell: "!", ModeEnv: "$", ModeSearch: "/", FileDefault: "◇", FileFolder: "▸", FileGo: "◈", FileJS: "◆", FileTS: "◆", FilePython: "◈", FileMarkdown: "◇", FileYAML: "◇", FileJSON: "◇", }
Symbols provides consistent iconography.
Functions ¶
func DefaultStylesheet ¶
func DefaultStylesheet() *style.Stylesheet
DefaultStylesheet returns the default stylesheet using the theme palette.
func LightStylesheet ¶
func LightStylesheet() *style.Stylesheet
LightStylesheet returns the light palette stylesheet.
func Stylesheet ¶
func Stylesheet(t *Theme) *style.Stylesheet
Stylesheet builds a stylesheet from the provided theme.
Types ¶
type Theme ¶
type Theme struct {
// Core palette
Background compositor.Style // Primary canvas
Surface compositor.Style // Elevated surfaces (cards, panels)
SurfaceRaised compositor.Style // Higher elevation
SurfaceDim compositor.Style // Recessed areas
// Text hierarchy
TextPrimary compositor.Style // Main content
TextSecondary compositor.Style // Supporting text
TextMuted compositor.Style // Hints, placeholders
TextInverse compositor.Style // Text on accent backgrounds
// Accent colors
Accent compositor.Style // Primary action, highlights
AccentDim compositor.Style // Subtle accent usage
AccentGlow compositor.Style // Emphasis, active states
ElectricBlue compositor.Style // Active processes, streaming
Coral compositor.Style // Warnings, errors, attention
Teal compositor.Style // Informational, metrics
// Glow variants
BlueGlow compositor.Style
PurpleGlow compositor.Style
CoralGlow compositor.Style
// Semantic colors
Success compositor.Style
Warning compositor.Style
Error compositor.Style
Info compositor.Style
// Message sources
User compositor.Style
Assistant compositor.Style
System compositor.Style
Tool compositor.Style
Thinking compositor.Style
// UI elements
Border compositor.Style
BorderFocus compositor.Style
Selection compositor.Style
SearchMatch compositor.Style
Scrollbar compositor.Style
ScrollThumb compositor.Style
// Mode indicators
ModeNormal compositor.Style
ModeShell compositor.Style
ModeEnv compositor.Style
ModeSearch compositor.Style
// Special
Logo compositor.Style
Spinner compositor.Style
}
Theme defines the complete visual language for the TUI.
func HighContrastTheme ¶
func HighContrastTheme() *Theme
HighContrastTheme returns a theme using only the 16 ANSI colors for maximum terminal compatibility. All color combinations target WCAG AAA (7:1) contrast ratios: bright white text on a black background, with bright yellow for focus indicators, bright cyan for links/info, and bright red for errors.
func LightTheme ¶
func LightTheme() *Theme
LightTheme returns a light variant of the default palette.