Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveDesignTokensForBothModes ¶
func ResolveDesignTokensForBothModes(queryParams map[string]string) (*DesignTokens, *DesignTokens)
ResolveDesignTokensForBothModes resolves design tokens for both light and dark modes This is useful for generating adaptive SVGs that respond to color scheme
Types ¶
type DesignTokens ¶
type DesignTokens struct {
Theme string
Color string
Background string
Accent string
FontFamily string
Radius int
Padding int
Density string // "compact" or "comfortable"
Mode string // "light" or "dark"
// Typography tokens (terminal relative sizing hints)
FontSizeXS string
FontSizeS string
FontSizeM string
FontSizeL string
FontSizeXL string
FontWeightNormal string
FontWeightBold string
// Selection tokens
SelectionBackground string // Color for selection highlight
SelectionForeground string // Text color when selected
// Toast tokens
ToastInfoColor string
ToastSuccessColor string
ToastWarningColor string
ToastErrorColor string
// Semantic status colors (two-tier: bright for confirmation, muted for metadata)
SuccessBright string // Primary success: dots, checks, 'Done'
SuccessMuted string // Secondary success: durations, supporting detail
ErrorBright string // Primary error: dots, crosses, 'Failed'
ErrorMuted string // Secondary error: durations, supporting detail
RunningColor string // Active/running state
PendingColor string // Warning/pending state
MutedColor string // Neutral metadata
// Deprecated: use SuccessBright/SuccessMuted etc. Kept for backward compat.
StatusSuccess string
StatusError string
StatusRunning string
StatusPending string
StatusMuted string
// Surface hierarchy
SurfaceBase string
SurfaceRaised string
SurfaceOverlay string
BorderSubtle string
// Diff colors
DiffAddBackground string
DiffRemoveBackground string
// Syntax colors
SyntaxKeyword string
SyntaxFunction string
SyntaxString string
SyntaxNumber string
SyntaxComment string
// Light/dark variant colors (if specified, override base colors based on mode)
ColorLight string
ColorDark string
BackgroundLight string
BackgroundDark string
AccentLight string
AccentDark string
// Radix UI theme tokens
RadixAccentColor string // "pink", "blue", "green", etc.
RadixGrayColor string // "mauve", "slate", "gray", etc.
RadixRadius string // "none", "small", "medium", "large", "full"
RadixScaling string // "90%", "95%", "100%", "105%", "110%"
// Layout configuration
Layout *LayoutTokens
}
DesignTokens represents visual design configuration
func CustomTheme ¶
func CustomTheme(params map[string]string) *DesignTokens
CustomTheme creates a theme from query parameters
func DefaultTheme ¶
func DefaultTheme() *DesignTokens
DefaultTheme returns the default design tokens
func MidnightTheme ¶
func MidnightTheme() *DesignTokens
MidnightTheme returns the midnight theme (dark mode)
func ResolveDesignTokens ¶
func ResolveDesignTokens(queryParams map[string]string) *DesignTokens
ResolveDesignTokens resolves design tokens from query parameters If auto_color_scheme is true, returns tokens that adapt to light/dark mode
func WrappedTheme ¶
func WrappedTheme() *DesignTokens
WrappedTheme returns the Wrapped theme (dark mode with special styling)
func (*DesignTokens) DarkMode ¶
func (dt *DesignTokens) DarkMode() *DesignTokens
DarkMode returns a copy of the tokens with dark mode applied
func (*DesignTokens) LightMode ¶
func (dt *DesignTokens) LightMode() *DesignTokens
LightMode returns a copy of the tokens with light mode applied
func (*DesignTokens) ToCSS ¶
func (dt *DesignTokens) ToCSS() string
ToCSS converts design tokens to CSS string for SVG
type LayoutTokens ¶
type LayoutTokens struct {
// Spacing scale (follows 8pt grid system)
SpaceXS int // 4px
SpaceS int // 8px
SpaceM int // 16px
SpaceL int // 20px
SpaceXL int // 24px
Space2XL int // 32px
// TUI-specific sizing defaults
ScrollbarWidth int // Width for scrollbars
ToastMaxWidth int // Maximum width for toast notifications
BreadcrumbMaxWidth int // Maximum width for breadcrumbs
// Card dimensions
CardPaddingLeft int // Horizontal padding inside cards
CardPaddingRight int
CardPaddingTop int // Vertical padding inside cards
CardPaddingBottom int
CardTitleHeight int // Height reserved for title area
CardIconWidth int // Width of icon
CardIconSpacing int // Space between icon and title
CardHeaderPadding int // Padding for header items
// Component heights
StatCardHeight int // Height for stat cards without trend
StatCardHeightTrend int // Height for stat cards with trend graph
TrendGraphMinHeight int // Minimum height for trend graphs
// Grid defaults
DefaultGridGap float64 // Default gap between grid items
DefaultGridWidth float64 // Default grid container width
DefaultGridColumns int // Default number of columns
}
LayoutTokens represents spacing and dimension configuration
func DefaultLayoutTokens ¶
func DefaultLayoutTokens() *LayoutTokens
DefaultLayoutTokens returns the default layout token values
type MotionTokens ¶
type MotionTokens struct {
Level string // "none", "subtle", "regular", "loud"
Durations map[string]string
Amplitudes map[string]float64
}
MotionTokens represents animation configuration
func ResolveMotionTokens ¶
func ResolveMotionTokens(queryParams map[string]string) *MotionTokens
ResolveMotionTokens resolves motion tokens from query parameters