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 ¶
- Variables
- func Apply(t *clibtheme.Theme)
- func CodeSpans(s string) string
- func CodeSpansWith(s string, base lipgloss.Style) string
- func DetectAutoOnce()
- func EntityColor(name string) lipgloss.Style
- func PriorityStyle(name string) (lipgloss.Style, bool)
- func Reload(t *clibtheme.Theme)
- func RenderEntityNames(names []string) string
- func Resolve(name string) *clibtheme.Theme
- func StatusStyle(name string) lipgloss.Style
Constants ¶
This section is empty.
Variables ¶
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.
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.
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.
var ( ColorStatusBarFg = Theme.MarkdownText.GetForeground() ColorTitleFg = Theme.MarkdownText.GetForeground() ColorHeaderFg = Theme.Blue.GetForeground() )
UI chrome colors.
var ( HelpKey = lipgloss.NewStyle().Foreground(Theme.Yellow.GetForeground()).Bold(true) HelpDesc = *Theme.Dim )
HelpKey / HelpDesc style key labels and descriptions in help/hint bars.
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.
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.
var ( Paused = lipgloss.NewStyle().Foreground(Theme.Red.GetForeground()).Bold(true) Active = lipgloss.NewStyle().Foreground(Theme.Green.GetForeground()).Bold(true) )
Refresh indicator styles.
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.
var HelpOverlay = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Theme.Dim.GetForeground()). Padding(1, 2)
HelpOverlay outer container style (rounded border, padded, no bg).
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.
var TableHeader = lipgloss.NewStyle(). Foreground(ColorHeaderFg). Bold(true). BorderStyle(lipgloss.NormalBorder()). BorderBottom(true)
TableHeader is the column header style for the issue list.
var Theme = config.DefaultTheme()
Theme is the shared clib theme instance.
var Title = lipgloss.NewStyle().Foreground(ColorTitleFg).Bold(true).Padding(0, 1)
Title for section/panel titles.
Functions ¶
func Apply ¶
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
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
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 ¶
EntityColor returns a deterministic style for a named entity (assignee, project, etc) by hashing into the fixed mid-tone entity palette.
func PriorityStyle ¶
PriorityStyle returns the style for a Jira priority name plus an ok flag.
func Reload ¶ added in v0.12.0
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 ¶
RenderEntityNames colors each name individually and joins with ", ".
func Resolve ¶
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 ¶
StatusStyle returns the style for a Jira status name. Falls back to the dim style for unknown statuses.
Types ¶
This section is empty.