theme

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package theme holds the colors and styles shared by the TUI panes.

Index

Constants

View Source
const (
	BoxFrameWidth  = 2
	BoxFrameHeight = 2
)

BoxFrame is the number of columns and rows a Box adds around its content.

Variables

View Source
var (
	Title  = lipgloss.NewStyle().Bold(true).Foreground(accent)
	Key    = lipgloss.NewStyle().Foreground(accent)
	Value  = lipgloss.NewStyle().Foreground(text)
	Alert  = lipgloss.NewStyle().Foreground(lipgloss.Color("#F87171")) // Bright red
	Header = lipgloss.NewStyle().Bold(true).Foreground(accent).Padding(0, 1)
	Cell   = lipgloss.NewStyle().Padding(0, 1)
	// Selected keeps the terminal's default foreground: colored cells reset
	// to it with SGR 39, so any other foreground would break off after them.
	Selected = lipgloss.NewStyle().Background(accent)
)

Functions

func Box

func Box(title string, width int, content string) string

Box renders content in a rounded border of the given outer width with title centered in the top border. Lipgloss borders have no titles, so the title is composed as a layer on top of the border. Content lines that don't fit are truncated, not wrapped.

func Bytes

func Bytes(b uint64) string

Bytes formats b in binary units with up to one decimal, e.g. "1.5 GiB".

func Dim

func Dim(s string) string

Dim renders s faint. Faint is used instead of a color for the same reason as in DirCell, and resets the same way.

func DimBox added in v1.1.0

func DimBox(title string, width int, content string) string

DimBox renders like Box with a gray border and title, for a pane shown next to the one that has the focus.

func DirCell

func DirCell(name string) string

DirCell marks a directory name in bold. Like StateCell, it resets only the bold attribute (SGR 22), so the selected row keeps its colors; a colored name would vanish on the accent background.

func FileCell

func FileCell(name string) string

FileCell dims a file name so that directories stand out.

func HeaderFor

func HeaderFor(dark bool) lipgloss.Style

HeaderFor returns the style of column headers and section titles for the terminal background: teal on dark backgrounds and dark teal on light ones. Header itself is used until the terminal reports its background, and on terminals that never do.

func HealthMark

func HealthMark(health string) string

HealthMark renders a container's health as a colored symbol that resets like StateCell: ✓ healthy, ✗ unhealthy, … starting and ? if the container has no healthcheck or the daemon doesn't report health.

func SelectedFor

func SelectedFor(dark bool) lipgloss.Style

SelectedFor returns the style of the selected table row for the terminal background. On light backgrounds the default foreground is dark, so the selection keeps the lighter accent there; Selected is used until the terminal reports its background.

func StateCell

func StateCell(state string) string

StateCell renders a container state as a dot in the state's color. It resets only the foreground color (SGR 39) instead of all attributes, so the background of the selected row is kept for the rest of the row.

Types

This section is empty.

Jump to

Keyboard shortcuts

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