tui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tui provides shared theme constants and styles for all Mithril TUI commands.

Index

Constants

This section is empty.

Variables

View Source
var (
	MithrilTeal = lipgloss.Color("85") // Primary accent

	// Text hierarchy (dark-mode optimized: no pure white, disabled still readable)
	ColorTextPrimary   = lipgloss.Color("#e0e0e0") // body text — bright but not glowing
	ColorTextSecondary = lipgloss.Color("#b0b0b0") // secondary labels — ~70% brightness
	ColorTextMuted     = lipgloss.Color("#787878") // key labels, captions — clearly readable
	ColorTextDisabled  = lipgloss.Color("#606060") // hints, shortcuts — visible on dark bg

	// Semantic
	ColorSuccess = MithrilTeal // teal doubles as success indicator
	ColorError   = lipgloss.Color("196")
	ColorWarn    = lipgloss.Color("214")

	// Borders
	ColorBorder       = lipgloss.Color("240") // unfocused
	ColorBorderActive = MithrilTeal           // focused
)

Mithril Server Theme — matches the teal accent used across all TUI commands. Primary color: ANSI 85 (teal), same as pkg/progress/progress.go bars.

View Source
var (
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(MithrilTeal)

	SuccessStyle = lipgloss.NewStyle().
					Foreground(ColorSuccess)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(ColorError)

	WarnStyle = lipgloss.NewStyle().
				Foreground(ColorWarn)

	DimStyle = lipgloss.NewStyle().
				Foreground(ColorTextMuted)
)

Shared styles

Functions

func AtomicWriteFile

func AtomicWriteFile(path string, data []byte, perm os.FileMode) error

AtomicWriteFile writes data to a file atomically using a temp file + rename. Prevents partial/corrupt files on crash. The file is created with the given permissions.

func RenderBanner

func RenderBanner() string

RenderBanner returns a compact one-line banner.

func RenderLogo() string

RenderLogo returns the full Mithril ASCII art logo, left-aligned with divider.

func RenderLogoWidth

func RenderLogoWidth(width int) string

RenderLogoWidth returns the logo centered within the given width. Falls back to compact banner if terminal is too narrow for the ASCII art.

Types

This section is empty.

Jump to

Keyboard shortcuts

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