Documentation
¶
Overview ¶
Package theme holds the colors and styles shared by the TUI panes.
Index ¶
- Constants
- Variables
- func Box(title string, width int, content string) string
- func Bytes(b uint64) string
- func Dim(s string) string
- func DirCell(name string) string
- func FileCell(name string) string
- func HeaderFor(dark bool) lipgloss.Style
- func HealthMark(health string) string
- func SelectedFor(dark bool) lipgloss.Style
- func StateCell(state string) string
Constants ¶
const ( BoxFrameWidth = 2 BoxFrameHeight = 2 )
BoxFrame is the number of columns and rows a Box adds around its content.
Variables ¶
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 ¶
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 Dim ¶
Dim renders s faint. Faint is used instead of a color for the same reason as in DirCell, and resets the same way.
func DirCell ¶
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 HeaderFor ¶
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 ¶
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 ¶
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.
Types ¶
This section is empty.