Help us shape the future of Go! Take the 2026 Go Developer Survey

styles

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package styles provides shared lipgloss v2 styles for CLI and TUI components.

Index

Constants

View Source
const (
	StatusIndicatorActive   = "[●]"
	StatusIndicatorApproval = "[!]"
	StatusIndicatorReady    = "[>]"
	StatusIndicatorMissing  = "[?]"
	StatusIndicatorRecycled = "[○]"
)

Status indicator constants for session display.

Variables

View Source
var (
	IconGithub    = "\uf09b "
	IconGitBranch = "\ue725"     //
	IconGit       = "\ue702"     //
	IconGitPR     = " "         // oct-git_pull_request
	IconCheckList = "\uf4a0 "    //
	IconMail      = "\ueb1c"     //
	IconBee       = "\U000F0FA1" // 󰾡
	IconHive      = "\U000F10CE" // 󱃎
	IconComment   = "\uf41f "

	IconTodo = "\uf4a0 " // checklist
	IconLink = " "      // oct-link

	IconFolder     = " "
	IconFolderOpen = " "
	IconFile       = " "

	IconNotifyError   = "\uf06a" //
	IconNotifyWarning = "\uf071" //
	IconNotifyInfo    = "\uf05a" //

	IconSelector = "󰅂"

	IconTodoPending      = "󰄱 "
	IconTodoAcknowledged = IconTodoPending // From a user perspective, acknowledged is only different from pending in that a UI notification was shown
	IconTodoCompleted    = "󰄵 "
	IconTodoDismissed    = "󱋭 "

	IconCircleCheck = "  " // oct-check_circle
	IconCircle      = "  " // oct-circle
	IconCircleX     = "  " // oct-x_circle

	IconIssueDraft  = "  " // oct-issue_draft
	IconIssueClosed = "  " // oct-issue_closed
	IconIssueOpen   = "  " // oct-issue_opened

	IconPerson = " " // oct-person
)
View Source
var (
	ColorPrimary    color.Color
	ColorSecondary  color.Color
	ColorForeground color.Color
	ColorMuted      color.Color
	ColorBackground color.Color
	ColorSurface    color.Color
	ColorSurfaceLow color.Color
	ColorSuccess    color.Color
	ColorWarning    color.Color
	ColorError      color.Color
)

Semantic color aliases set by SetTheme.

View Source
var (
	// CLI styles.
	CommandHeaderStyle lipgloss.Style

	// TUI shared styles.
	ModalStyle               lipgloss.Style
	ModalDangerStyle         lipgloss.Style
	FormModalStyle           lipgloss.Style
	ModalTitleStyle          lipgloss.Style
	ModalDangerTitleStyle    lipgloss.Style
	ModalHelpStyle           lipgloss.Style
	ModalButtonStyle         lipgloss.Style
	ModalButtonSelectedStyle lipgloss.Style
	ModalInputStyle          lipgloss.Style
	ModalInputReadyStyle     lipgloss.Style
	TextMutedStyle           lipgloss.Style
	TextPrimaryStyle         lipgloss.Style
	TextPrimaryBoldStyle     lipgloss.Style
	TextSecondaryStyle       lipgloss.Style
	TextForegroundStyle      lipgloss.Style
	TextForegroundBoldStyle  lipgloss.Style
	TextSuccessStyle         lipgloss.Style
	TextWarningStyle         lipgloss.Style
	TextErrorStyle           lipgloss.Style
	TextSurfaceStyle         lipgloss.Style

	ViewSelectedStyle lipgloss.Style
	ViewNormalStyle   lipgloss.Style

	FormTitleStyle        lipgloss.Style
	FormFieldStyle        lipgloss.Style
	FormFieldFocusedStyle lipgloss.Style

	// Help dialog styles.
	HelpDialogSectionStyle lipgloss.Style

	// Confirm modal styles.
	ConfirmMessageStyle lipgloss.Style

	// Review comment modal styles.
	ReviewCommentTitleStyle   lipgloss.Style
	ReviewCommentLabelStyle   lipgloss.Style
	ReviewCommentContextStyle lipgloss.Style
	ReviewCommentHelpStyle    lipgloss.Style

	// Review finalize modal styles.
	ReviewFinalizeOptionStyle lipgloss.Style
	ReviewFinalizeModalStyle  lipgloss.Style

	// Review view styles.
	ReviewEmptyMessageStyle       lipgloss.Style
	ReviewOverlayModalStyle       lipgloss.Style
	ReviewSelectionStyle          lipgloss.Style
	ReviewCursorStyle             lipgloss.Style
	ReviewSearchMatchStyle        lipgloss.Style
	ReviewCurrentSearchMatchStyle lipgloss.Style
	ReviewCommentedLineNumStyle   lipgloss.Style
	ReviewSearchInputStyle        lipgloss.Style
	ReviewModeNormalStyle         lipgloss.Style
	ReviewModeVisualStyle         lipgloss.Style
	ReviewModeSearchStyle         lipgloss.Style
	ReviewPosStyle                lipgloss.Style
	ReviewHelpStyle               lipgloss.Style
	ReviewStatusBarBgStyle        lipgloss.Style
	ReviewInlineCommentStyle      lipgloss.Style

	ReviewTreeHeaderStyle         lipgloss.Style
	ReviewTreeHeaderSelectedStyle lipgloss.Style

	// Messages view styles.
	MessagesHelpStyle            lipgloss.Style
	MessagesPayloadSelectedStyle lipgloss.Style

	// Command palette styles.
	CommandPaletteHelpSelectedStyle lipgloss.Style
	CommandPaletteMoreStyle         lipgloss.Style

	// Toast styles.
	ToastInfoStyle    lipgloss.Style
	ToastWarningStyle lipgloss.Style
	ToastErrorStyle   lipgloss.Style

	// Select field styles.
	SelectFieldItemSelectedStyle lipgloss.Style

	// Status bar style.
	StatusBarStyle lipgloss.Style

	// TUI layout styles.
	ListFilterPromptStyle  lipgloss.Style
	ListHelpContainerStyle lipgloss.Style
	TabBrandingStyle       lipgloss.Style
	TabUpdateBadgeStyle    lipgloss.Style
	PreviewHeaderNameStyle lipgloss.Style
	PreviewTopicStyle      lipgloss.Style
	PreviewSessionStyle    lipgloss.Style
)

Style exports.

View Source
var ColorPool []color.Color

ColorPool is used for deterministic color hashing of topics and senders.

View Source
var CurrentPalette theme.Palette

CurrentPalette holds the active theme palette.

Functions

func ColorForString

func ColorForString(s string) color.Color

ColorForString returns a deterministic color for a given string. The same string always produces the same color.

func GlamourStyle

func GlamourStyle() glamouransi.StyleConfig

GlamourStyle returns a Glamour style config derived from the active theme.

func PulseColor

func PulseColor(base color.Color, frame, frames int, minBrightness float64) color.Color

PulseColor returns a color dimmed by a triangle-wave brightness cycle. frame is the current animation frame, frames is the total cycle length, and minBrightness (0.0–1.0) controls how dim the color gets at the midpoint.

func RenderStatusIndicator

func RenderStatusIndicator(status terminal.Status) string

RenderStatusIndicator returns a colored status indicator string for the given terminal status.

func SetTheme

func SetTheme(p theme.Palette)

SetTheme sets the active palette and rebuilds all global styles.

Types

type CLIOutputStyler

type CLIOutputStyler struct{}

CLIOutputStyler styles the headers that hooks and file copies print. It reads the package styles on each call, so it follows a theme change.

func (CLIOutputStyler) Header

func (CLIOutputStyler) Header(s string) string

func (CLIOutputStyler) Muted

func (CLIOutputStyler) Muted(s string) string

func (CLIOutputStyler) Text

func (CLIOutputStyler) Text(s string) string

Jump to

Keyboard shortcuts

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