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

theme

package
v0.7.225 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package theme is the shared palette and pane drawing for chunk's full-screen TUIs (chunk watch and the planning screen), computed for the terminal's current background.

Index

Constants

View Source
const ListWidth = 32

ListWidth is the text width of the list pane on the left of chunk watch's tabs, so the panes keep their place when switching between them.

Variables

View Source
var (
	Yellow = lipgloss.Color("#FFF700")
	Navy   = lipgloss.Color("#2E3C52")
	Green  = lipgloss.Color("#00DB73")
)

Chunk brand colours. The accent is navy on a light terminal, where yellow would vanish, and yellow on a dark one.

Functions

func EdgeSegment

func EdgeSegment(line func(string) string, title string, n int) string

EdgeSegment is n cells of a frame edge drawn with line, with title set into it as in "─ runs ─────" and cut to leave at least one cell of edge after it.

func Help

func Help(st Styles, width int) help.Model

Help is a help view styled with st, fitting width.

Types

type Styles

type Styles struct {
	Dim      lipgloss.Style
	Emphasis lipgloss.Style
	Success  lipgloss.Style
	Warning  lipgloss.Style
	Running  lipgloss.Style
	// Brand is chunk's accent colour as text.
	Brand lipgloss.Style
	Error lipgloss.Style
	Muted lipgloss.Style
	VDim  lipgloss.Style
	// Chip is the base of a coloured label; the caller sets its background.
	Chip lipgloss.Style
	// Accent is filled with the brand colour, for the one primary action a
	// screen offers (e.g. sending a draft to the factory), so it reads as a
	// button next to the dimmed, bracketed hints for everything else.
	Accent lipgloss.Style
	// Field is the faint ground of a text input, so where to type is easy to
	// find on the terminal's own background.
	Field lipgloss.Style
}

Styles holds lipgloss styles computed for the current terminal background, shared by the full-screen TUIs.

func New

func New(dark bool) Styles

New returns the styles for a terminal with a dark background, or a light one.

func (Styles) Pane

func (s Styles) Pane(focused bool, w, h int, title, body string) string

Pane draws body in a rounded box w cells wide and h tall, border included, with title set into its top edge. The focused pane's border is the accent and the others' are quiet. body must already fit inside the border.

func (Styles) Tabs added in v0.7.225

func (s Styles) Tabs(active int, names ...string) string

Tabs names a screen's tabs, the one showing in the accent and the others quiet.

Jump to

Keyboard shortcuts

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