theme

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package theme defines lipgloss styles shared across the Jira TUI. The structure mirrors pagerduty-client's theme: package-level style vars derived from a clib theme, applied once via Apply(). All chrome and content styles are derived from clib theme colors so that swapping the underlying theme reskins the entire TUI.

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusToDo       = lipgloss.NewStyle().Foreground(Theme.Blue.GetForeground())
	StatusInProgress = lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground()).Bold(true)
	StatusDone       = lipgloss.NewStyle().Foreground(Theme.Green.GetForeground())
	StatusBlocked    = lipgloss.NewStyle().Foreground(Theme.Red.GetForeground()).Bold(true)
)

Status styles — mapped to Jira issue status categories.

View Source
var (
	StatusOK  = lipgloss.NewStyle().Foreground(Theme.Green.GetForeground()).Bold(true)
	StatusErr = lipgloss.NewStyle().Foreground(Theme.Red.GetForeground()).Bold(true)
)

Status flash styles for action feedback.

View Source
var (
	Pill        = lipgloss.NewStyle().Padding(0, 1)
	PillDanger  = Pill.Foreground(Theme.Red.GetForeground()).Bold(true)
	PillWarning = Pill.Foreground(Theme.Yellow.GetForeground())
	PillDim     = Pill.Faint(true)
	PillOK      = Pill.Foreground(Theme.Green.GetForeground())
)

Pill styles for header counts.

View Source
var (
	ColorStatusBarFg = Theme.MarkdownText.GetForeground()
	ColorTitleFg     = Theme.MarkdownText.GetForeground()
	ColorHeaderFg    = Theme.Blue.GetForeground()
)

UI chrome colors.

View Source
var (
	HelpKey  = lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground()).Bold(true)
	HelpDesc = *Theme.Dim
)

HelpKey / HelpDesc style key labels and descriptions in help/hint bars.

View Source
var (
	DetailHeader = lipgloss.NewStyle().Bold(true).Foreground(Theme.Magenta.GetForeground())
	DetailLabel  = lipgloss.NewStyle().Bold(true).Foreground(Theme.Green.GetForeground())
	DetailValue  = lipgloss.NewStyle().Foreground(Theme.MarkdownText.GetForeground())
	DetailDim    = lipgloss.NewStyle().Faint(true)
)

Detail view styles for the issue detail viewport.

View Source
var (
	TypeEpic    = lipgloss.NewStyle().Foreground(Theme.Magenta.GetForeground())
	TypeStory   = lipgloss.NewStyle().Foreground(Theme.Green.GetForeground())
	TypeTask    = lipgloss.NewStyle().Foreground(Theme.Blue.GetForeground())
	TypeSubtask = lipgloss.NewStyle().Foreground(Theme.Blue.GetForeground()).Faint(true)
	TypeBug     = lipgloss.NewStyle().Foreground(Theme.Red.GetForeground())
	TypeOther   = lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground())
)

Issue-type badge styles — color is the primary signal for the type glyph.

View Source
var (
	Paused = lipgloss.NewStyle().Foreground(Theme.Red.GetForeground()).Bold(true)
	Active = lipgloss.NewStyle().Foreground(Theme.Green.GetForeground()).Bold(true)
)

Refresh indicator styles.

View Source
var Code = lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground())

Code is the inline-code accent, matching the markdown renderer's code color so a `span` reads the same in a summary cell and a rendered description.

View Source
var HelpOverlay = lipgloss.NewStyle().
	Border(lipgloss.RoundedBorder()).
	BorderForeground(Theme.Dim.GetForeground()).
	Padding(1, 2)

HelpOverlay outer container style (rounded border, padded, no bg).

View Source
var PriorityStyles = map[string]lipgloss.Style{
	"Highest": lipgloss.NewStyle().Foreground(Theme.Red.GetForeground()).Bold(true),
	"High":    lipgloss.NewStyle().Foreground(Theme.Orange.GetForeground()).Bold(true),
	"Medium":  lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground()),
	"Low":     lipgloss.NewStyle().Foreground(Theme.Blue.GetForeground()),
	"Lowest":  lipgloss.NewStyle().Faint(true),
}

Priority styles — Jira priority labels.

View Source
var TableHeader = lipgloss.NewStyle().
	Foreground(ColorHeaderFg).
	Bold(true).
	BorderStyle(lipgloss.NormalBorder()).
	BorderBottom(true)

TableHeader is the column header style for the issue list.

Theme is the shared clib theme instance.

View Source
var Title = lipgloss.NewStyle().Foreground(ColorTitleFg).Bold(true).Padding(0, 1)

Title for section/panel titles.

Functions

func Apply

func Apply(t *clibtheme.Theme)

Apply resets all derived styles to the given clib theme. Runs at most once per process; subsequent calls are no-ops (matching pdc's pattern, which avoids style flicker mid-render). A deliberate theme change at runtime goes through Reload instead.

func CodeSpans added in v0.12.0

func CodeSpans(s string) string

CodeSpans styles `backtick` spans in s with the Code accent, backticks kept — the display width is unchanged, so cell-budgeted callers truncate first and style after. An unpaired backtick renders as-is.

func CodeSpansWith added in v0.12.0

func CodeSpansWith(s string, base lipgloss.Style) string

CodeSpansWith is CodeSpans over a styled base: plain segments render with base and spans with the Code accent layered on it, segment by segment, so a span's SGR reset can never cut the base style off mid-string. Callers wrap and truncate the raw text first — this must be the last styling pass.

func DetectAutoOnce added in v0.12.0

func DetectAutoOnce()

DetectAutoOnce performs the terminal-background detection for the "auto" theme and caches it. Call it exactly once, before the Bubble Tea program starts; every later Resolve("auto") — a theme preview, a config reload — reuses the cached answer instead of racing the program for stdin.

func EntityColor

func EntityColor(name string) lipgloss.Style

EntityColor returns a deterministic style for a named entity (assignee, project, etc) by hashing into the fixed mid-tone entity palette.

func PriorityStyle

func PriorityStyle(name string) (lipgloss.Style, bool)

PriorityStyle returns the style for a Jira priority name plus an ok flag.

func Reload added in v0.12.0

func Reload(t *clibtheme.Theme)

Reload swaps the active theme at runtime — the config hot-reload path. Unlike Apply it is not once-guarded: the caller signals a real theme change, owns the frame cadence (the reload lands between renders on the Update goroutine), and rebuilds anything that cached derived styles.

func RenderEntityNames

func RenderEntityNames(names []string) string

RenderEntityNames colors each name individually and joins with ", ".

func Resolve

func Resolve(name string) *clibtheme.Theme

Resolve returns a clib theme for the given preset name. The "auto" name picks clib's light or dark theme from the startup background detection (see DetectAutoOnce) so hash-based entity colors contrast. An empty or unrecognized name falls back to the process default, which honors the JIRA_THEME override before the dark built-in.

func StatusStyle

func StatusStyle(name string) lipgloss.Style

StatusStyle returns the style for a Jira status name. Falls back to the dim style for unknown statuses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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