Documentation
¶
Overview ¶
Package styles provides shared lipgloss styles for UI components.
This package centralizes color definitions and styling to ensure visual consistency across all UI components (static, progress, prompt, and wizard packages).
Index ¶
- Variables
- func FormatPRState(state string, isDraft bool) string
- func Init(cfg config.ThemeConfig)
- func NerdfontEnabled() bool
- func PRClosedSymbol() string
- func PRDraftSymbol() string
- func PRMergedSymbol() string
- func PROpenSymbol() string
- func PRStateSymbol(state string, isDraft bool) string
- func PresetNames() []string
- func SetNerdfont(enabled bool)
- type Symbols
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ( // Primary is the main accent color (cyan/teal) Primary lipgloss.TerminalColor = lipgloss.Color("62") // Accent is the highlight color for selected/active items (pink) Accent lipgloss.TerminalColor = lipgloss.Color("212") // Success is used for checkmarks and positive outcomes (green) Success lipgloss.TerminalColor = lipgloss.Color("82") // Error is used for error messages (red) Error lipgloss.TerminalColor = lipgloss.Color("196") // Muted is used for disabled/inactive text (gray) Muted lipgloss.TerminalColor = lipgloss.Color("240") // Normal is the standard text color (light gray) Normal lipgloss.TerminalColor = lipgloss.Color("252") // Info is used for informational text (gray) Info lipgloss.TerminalColor = lipgloss.Color("244") )
Primary colors used throughout the UI
var ( // Bold applies bold formatting Bold = lipgloss.NewStyle().Bold(true) // Italic applies italic formatting Italic = lipgloss.NewStyle().Italic(true) // PrimaryStyle applies the primary color PrimaryStyle = lipgloss.NewStyle().Foreground(Primary) // AccentStyle applies the accent color with bold AccentStyle = lipgloss.NewStyle(). Foreground(Accent). Bold(true) // SuccessStyle applies the success color SuccessStyle = lipgloss.NewStyle().Foreground(Success) // ErrorStyle applies the error color ErrorStyle = lipgloss.NewStyle().Foreground(Error) // MutedStyle applies the muted color MutedStyle = lipgloss.NewStyle().Foreground(Muted) // NormalStyle applies the normal text color NormalStyle = lipgloss.NewStyle().Foreground(Normal) // InfoStyle applies the info color with italic InfoStyle = lipgloss.NewStyle(). Foreground(Info). Italic(true) )
Common styles
var ( // DefaultTheme is the default color scheme DefaultTheme = Theme{ Primary: lipgloss.Color("62"), Accent: lipgloss.Color("212"), Success: lipgloss.Color("82"), Error: lipgloss.Color("196"), Muted: lipgloss.Color("240"), Normal: lipgloss.Color("252"), Info: lipgloss.Color("244"), } // DraculaTheme is based on the Dracula color scheme DraculaTheme = Theme{ Primary: lipgloss.Color("#bd93f9"), Accent: lipgloss.Color("#ff79c6"), Success: lipgloss.Color("#50fa7b"), Error: lipgloss.Color("#ff5555"), Muted: lipgloss.Color("#6272a4"), Normal: lipgloss.Color("#f8f8f2"), Info: lipgloss.Color("#8be9fd"), } // NordTheme is based on the Nord color scheme NordTheme = Theme{ Primary: lipgloss.Color("#88c0d0"), Accent: lipgloss.Color("#b48ead"), Success: lipgloss.Color("#a3be8c"), Error: lipgloss.Color("#bf616a"), Muted: lipgloss.Color("#4c566a"), Normal: lipgloss.Color("#eceff4"), Info: lipgloss.Color("#81a1c1"), } // GruvboxTheme is based on the Gruvbox color scheme (dark) GruvboxTheme = Theme{ Primary: lipgloss.Color("#83a598"), Accent: lipgloss.Color("#d3869b"), Success: lipgloss.Color("#b8bb26"), Error: lipgloss.Color("#fb4934"), Muted: lipgloss.Color("#665c54"), Normal: lipgloss.Color("#ebdbb2"), Info: lipgloss.Color("#8ec07c"), } // CatppuccinFrappeTheme is based on Catppuccin Frappé CatppuccinFrappeTheme = Theme{ Primary: lipgloss.Color("#8caaee"), Accent: lipgloss.Color("#f4b8e4"), Success: lipgloss.Color("#a6d189"), Error: lipgloss.Color("#e78284"), Muted: lipgloss.Color("#626880"), Normal: lipgloss.Color("#c6d0f5"), Info: lipgloss.Color("#99d1db"), } // CatppuccinMochaTheme is based on Catppuccin Mocha CatppuccinMochaTheme = Theme{ Primary: lipgloss.Color("#89b4fa"), Accent: lipgloss.Color("#f5c2e7"), Success: lipgloss.Color("#a6e3a1"), Error: lipgloss.Color("#f38ba8"), Muted: lipgloss.Color("#6c7086"), Normal: lipgloss.Color("#cdd6f4"), Info: lipgloss.Color("#94e2d5"), } )
Preset themes
var ( // HighlightStyle for highlighting matched characters (pink, bold, underline) HighlightStyle = lipgloss.NewStyle(). Foreground(Accent). Bold(true). Underline(true) )
Text highlighting styles
var ( // RoundedBorder creates a rounded border with primary color RoundedBorder = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Primary). Padding(1, 2) )
Border styles
Functions ¶
func FormatPRState ¶
FormatPRState returns a formatted string with symbol and state state should be "MERGED", "OPEN", "CLOSED", or empty isDraft indicates if the PR is a draft (only applies to OPEN state)
func Init ¶
func Init(cfg config.ThemeConfig)
Init initializes the theme from config Call this after loading config and before displaying any UI
func NerdfontEnabled ¶
func NerdfontEnabled() bool
NerdfontEnabled returns whether nerd font symbols are enabled
func PRStateSymbol ¶
PRStateSymbol returns just the symbol for a PR state
Types ¶
type Theme ¶
type Theme struct {
Primary lipgloss.TerminalColor // main accent color (borders, titles)
Accent lipgloss.TerminalColor // highlight color (selected items)
Success lipgloss.TerminalColor // success indicators (checkmarks)
Error lipgloss.TerminalColor // error messages
Muted lipgloss.TerminalColor // disabled/inactive text
Normal lipgloss.TerminalColor // standard text
Info lipgloss.TerminalColor // informational text
}
Theme defines the color palette for UI components