styles

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

View Source
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

View Source
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

View Source
var (
	// HighlightStyle for highlighting matched characters (pink, bold, underline)
	HighlightStyle = lipgloss.NewStyle().
		Foreground(Accent).
		Bold(true).
		Underline(true)
)

Text highlighting styles

View Source
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

func FormatPRState(state string, isDraft bool) string

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 PRClosedSymbol

func PRClosedSymbol() string

PRClosedSymbol returns the symbol for closed PRs

func PRDraftSymbol

func PRDraftSymbol() string

PRDraftSymbol returns the symbol for draft PRs

func PRMergedSymbol

func PRMergedSymbol() string

PRMergedSymbol returns the symbol for merged PRs

func PROpenSymbol

func PROpenSymbol() string

PROpenSymbol returns the symbol for open PRs

func PRStateSymbol

func PRStateSymbol(state string, isDraft bool) string

PRStateSymbol returns just the symbol for a PR state

func PresetNames

func PresetNames() []string

PresetNames returns a list of available preset names

func SetNerdfont

func SetNerdfont(enabled bool)

SetNerdfont enables or disables nerd font symbols

Types

type Symbols

type Symbols struct {
	PRMerged string
	PROpen   string
	PRClosed string
	PRDraft  string
}

Symbols holds the icon/symbol set based on nerdfont configuration

func CurrentSymbols

func CurrentSymbols() Symbols

CurrentSymbols returns the current symbol set

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

func Current

func Current() Theme

Current returns the current theme

func GetPreset

func GetPreset(name string) *Theme

GetPreset returns a theme preset by name, or nil if not found

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL