styles

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package styles provides styling for the Lux TUI using lipgloss.

Index

Constants

This section is empty.

Variables

View Source
var (
	Primary   = lipgloss.Color("#7C3AED") // Purple
	Secondary = lipgloss.Color("#3B82F6") // Blue
	Success   = lipgloss.Color("#10B981") // Green
	Warning   = lipgloss.Color("#F59E0B") // Amber
	Error     = lipgloss.Color("#EF4444") // Red
	Muted     = lipgloss.Color("#6B7280") // Gray
	Text      = lipgloss.Color("#F9FAFB") // Light text
	Border    = lipgloss.Color("#374151") // Dark gray
)

Colors

View Source
var (
	// Title style
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(Primary).
				MarginBottom(1)

	// Tab styles
	TabStyle = lipgloss.NewStyle().
				Padding(0, 2).
				Foreground(Muted)

	ActiveTabStyle = lipgloss.NewStyle().
					Padding(0, 2).
					Foreground(Text).
					Background(Primary).
					Bold(true)

	// Footer style
	FooterStyle = lipgloss.NewStyle().
				Foreground(Muted).
				MarginTop(1)

	// Error style
	ErrorStyle = lipgloss.NewStyle().
				Foreground(Error).
				Bold(true)

	// Success style
	SuccessStyle = lipgloss.NewStyle().
					Foreground(Success)

	// Warning style
	WarningStyle = lipgloss.NewStyle().
					Foreground(Warning)

	// Spinner style
	SpinnerStyle = lipgloss.NewStyle().
					Foreground(Primary)

	// Box style
	BoxStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(Border).
				Padding(1, 2)

	// Table header style
	TableHeaderStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(Primary).
						BorderBottom(true).
						BorderStyle(lipgloss.NormalBorder()).
						BorderForeground(Border)

	// Table row style
	TableRowStyle = lipgloss.NewStyle().
					Padding(0, 1)

	// Selected row style
	SelectedRowStyle = lipgloss.NewStyle().
						Background(Primary).
						Foreground(Text).
						Bold(true)

	// Status styles
	StatusHealthy = lipgloss.NewStyle().
					Foreground(Success).
					Bold(true)

	StatusUnhealthy = lipgloss.NewStyle().
					Foreground(Error).
					Bold(true)

	StatusPending = lipgloss.NewStyle().
					Foreground(Warning)

	// Label style
	LabelStyle = lipgloss.NewStyle().
				Foreground(Muted)

	// Value style
	ValueStyle = lipgloss.NewStyle().
				Foreground(Text).
				Bold(true)

	// Section title style
	SectionTitleStyle = lipgloss.NewStyle().
						Foreground(Secondary).
						Bold(true).
						MarginTop(1).
						MarginBottom(1)

	// MutedStyle for subdued text rendering
	MutedStyle = lipgloss.NewStyle().
				Foreground(Muted)
)

Component styles

Functions

func Box

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

Box creates a boxed content

func CenterText

func CenterText(text string, width int) string

CenterText centers text within a given width

func FormatStatus

func FormatStatus(status string) string

FormatStatus formats a status with appropriate styling

func StatusStyle

func StatusStyle(status string) lipgloss.Style

StatusStyle returns the appropriate style for a status string

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to a maximum length

Types

type LogLevelStyle

type LogLevelStyle struct {
	Style lipgloss.Style
}

LogLevelStyle is a wrapper for log level styling

func (LogLevelStyle) Render

func (l LogLevelStyle) Render(text string) string

Render renders text with this style

Jump to

Keyboard shortcuts

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