theme

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailColors

type DetailColors struct {
	BorderColor   string `yaml:"border_color"`
	LabelFg       string `yaml:"label_fg"`
	ValueFg       string `yaml:"value_fg"`
	TabActiveBg   string `yaml:"tab_active_bg"`
	TabActiveFg   string `yaml:"tab_active_fg"`
	TabInactiveFg string `yaml:"tab_inactive_fg"`
}

DetailColors defines colors for the detail panel.

type SidebarColors

type SidebarColors struct {
	Background          string `yaml:"background"`
	Foreground          string `yaml:"foreground"`
	SelectedBg          string `yaml:"selected_bg"`
	SelectedFg          string `yaml:"selected_fg"`
	UnfocusedSelectedBg string `yaml:"unfocused_selected_bg"`
	UnfocusedSelectedFg string `yaml:"unfocused_selected_fg"`
	CategoryFg          string `yaml:"category_fg"`
}

SidebarColors defines colors for the sidebar panel.

type StatusBarColors

type StatusBarColors struct {
	Background  string `yaml:"background"`
	Foreground  string `yaml:"foreground"`
	ClusterFg   string `yaml:"cluster_fg"`
	NamespaceFg string `yaml:"namespace_fg"`
	ContextFg   string `yaml:"context_fg"`
}

StatusBarColors defines colors for the top status bar.

type StatusColors

type StatusColors struct {
	Running string `yaml:"running"`
	Pending string `yaml:"pending"`
	Error   string `yaml:"error"`
	Unknown string `yaml:"unknown"`
}

StatusColors defines colors for resource status indicators.

type StatusLineColors

type StatusLineColors struct {
	Background string `yaml:"background"`
	Foreground string `yaml:"foreground"`
}

StatusLineColors defines colors for the bottom hints bar.

type TableColors

type TableColors struct {
	HeaderBg               string `yaml:"header_bg"`
	HeaderFg               string `yaml:"header_fg"`
	RowFg                  string `yaml:"row_fg"`
	SelectedRowBg          string `yaml:"selected_row_bg"`
	SelectedRowFg          string `yaml:"selected_row_fg"`
	UnfocusedSelectedRowBg string `yaml:"unfocused_selected_row_bg"`
	UnfocusedSelectedRowFg string `yaml:"unfocused_selected_row_fg"`
	AlternatingBg          string `yaml:"alternating_bg"`
}

TableColors defines colors for the resource table.

type Theme

type Theme struct {
	Sidebar    SidebarColors    `yaml:"sidebar"`
	Table      TableColors      `yaml:"table"`
	Detail     DetailColors     `yaml:"detail"`
	StatusBar  StatusBarColors  `yaml:"status_bar"`
	StatusLine StatusLineColors `yaml:"status_line"`
	Status     StatusColors     `yaml:"status"`
}

Theme defines colors for all UI elements in km8.

func DefaultTheme

func DefaultTheme() *Theme

DefaultTheme returns a sensible dark theme with Catppuccin-inspired colors.

func LoadTheme

func LoadTheme(path string) (*Theme, error)

LoadTheme reads a theme.yaml from the given path and merges it with the default theme. Fields not present in the YAML file retain their default values. If path is empty or the file does not exist, the default theme is returned without error.

func (*Theme) DetailBorderStyle

func (t *Theme) DetailBorderStyle() lipgloss.Style

DetailBorderStyle returns the style for the detail panel border.

func (*Theme) DetailLabelStyle

func (t *Theme) DetailLabelStyle() lipgloss.Style

DetailLabelStyle returns the style for labels in the detail panel.

func (*Theme) DetailTabActiveStyle

func (t *Theme) DetailTabActiveStyle() lipgloss.Style

DetailTabActiveStyle returns the style for the active tab.

func (*Theme) DetailTabInactiveStyle

func (t *Theme) DetailTabInactiveStyle() lipgloss.Style

DetailTabInactiveStyle returns the style for inactive tabs.

func (*Theme) DetailValueStyle

func (t *Theme) DetailValueStyle() lipgloss.Style

DetailValueStyle returns the style for values in the detail panel.

func (*Theme) SidebarCategoryStyle

func (t *Theme) SidebarCategoryStyle() lipgloss.Style

SidebarCategoryStyle returns the style for sidebar category headers.

func (*Theme) SidebarSelectedStyle

func (t *Theme) SidebarSelectedStyle() lipgloss.Style

SidebarSelectedStyle returns the style for the selected sidebar item while the sidebar panel has focus — bg highlight + bold, the classic "you're driving this row" cursor look.

func (*Theme) SidebarStyle

func (t *Theme) SidebarStyle() lipgloss.Style

SidebarStyle returns the base style for the sidebar panel.

func (*Theme) SidebarUnfocusedSelectedStyle added in v1.4.0

func (t *Theme) SidebarUnfocusedSelectedStyle() lipgloss.Style

SidebarUnfocusedSelectedStyle returns the style for the currently-active resource when the sidebar isn't focused — softer bg than the focused cursor plus bold, so the panel still reads as having a "remembered" selection without competing visually with the focused panel.

func (*Theme) StatusBarClusterStyle

func (t *Theme) StatusBarClusterStyle() lipgloss.Style

StatusBarClusterStyle returns the style for the cluster name in the status bar.

func (*Theme) StatusBarContextStyle

func (t *Theme) StatusBarContextStyle() lipgloss.Style

StatusBarContextStyle returns the style for the context in the status bar.

func (*Theme) StatusBarNamespaceStyle

func (t *Theme) StatusBarNamespaceStyle() lipgloss.Style

StatusBarNamespaceStyle returns the style for the namespace in the status bar.

func (*Theme) StatusBarStyle

func (t *Theme) StatusBarStyle() lipgloss.Style

StatusBarStyle returns the base style for the status bar.

func (*Theme) StatusErrorStyle

func (t *Theme) StatusErrorStyle() lipgloss.Style

StatusErrorStyle returns the style for error/failed status.

func (*Theme) StatusLineStyle

func (t *Theme) StatusLineStyle() lipgloss.Style

StatusLineStyle returns the style for the bottom hints bar.

func (*Theme) StatusPendingStyle

func (t *Theme) StatusPendingStyle() lipgloss.Style

StatusPendingStyle returns the style for pending/warning status.

func (*Theme) StatusRunningStyle

func (t *Theme) StatusRunningStyle() lipgloss.Style

StatusRunningStyle returns the style for running/ready status.

func (*Theme) StatusUnknownStyle

func (t *Theme) StatusUnknownStyle() lipgloss.Style

StatusUnknownStyle returns the style for unknown status.

func (*Theme) TableAlternatingRowStyle

func (t *Theme) TableAlternatingRowStyle() lipgloss.Style

TableAlternatingRowStyle returns the style for alternating table rows.

func (*Theme) TableHeaderStyle

func (t *Theme) TableHeaderStyle() lipgloss.Style

TableHeaderStyle returns the style for table column headers.

func (*Theme) TableRowStyle

func (t *Theme) TableRowStyle() lipgloss.Style

TableRowStyle returns the style for a normal table row.

func (*Theme) TableSelectedRowStyle

func (t *Theme) TableSelectedRowStyle() lipgloss.Style

TableSelectedRowStyle returns the style for the table cursor row while the table panel has focus — bg highlight + bold.

func (*Theme) TableUnfocusedSelectedRowStyle added in v1.4.0

func (t *Theme) TableUnfocusedSelectedRowStyle() lipgloss.Style

TableUnfocusedSelectedRowStyle returns the style for the table cursor row when the table isn't focused — softer bg than focused + bold, matching SidebarUnfocusedSelectedStyle.

Jump to

Keyboard shortcuts

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