style

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package style provides object for styling the TUI.

Index

Constants

This section is empty.

Variables

View Source
var (
	// StandardHeight is the height of the main window.
	StandardHeight = 13

	// Base is the box of the main window.
	Base = Box()
	// Error is the style for errors.
	Error = func() lipgloss.Style { return lipgloss.NewStyle().Foreground(errorColor) }
	// Foreground is the main style.
	Foreground = func() lipgloss.Style { return lipgloss.NewStyle().Foreground(primaryDarkestColor) }
	// NoError is the style for positive results.
	NoError = func() lipgloss.Style { return lipgloss.NewStyle().Foreground(green) }
	// AccentForeground is the secondary style.
	AccentForeground = func() lipgloss.Style { return lipgloss.NewStyle().Foreground(primaryColor) }

	// Title1 is the most accentuated style for titles.
	Title1 = func() lipgloss.Style {
		return lipgloss.NewStyle().
			Bold(true).
			Foreground(white).
			Background(primaryDarkestColor).
			Align(lipgloss.Center).
			Width(22)
	}

	// Title2 is the second accent style for titles.
	Title2 = func() lipgloss.Style {
		return lipgloss.NewStyle().
			Bold(true).
			Foreground(primaryDarkestColor).
			Width(22)
	}

	// LogTitle is the style for the log page title.
	LogTitle = func() lipgloss.Style {
		return Box().Padding(0, 1)
	}

	// LogInfo is the style for the log page info.
	LogInfo = func() lipgloss.Style {
		return LogTitle().Copy()
	}
	// LeftVerticalSeparator is the style to make a vertical separator on the left.
	LeftVerticalSeparator = func() lipgloss.Style {
		return lipgloss.NewStyle().
			BorderStyle(lipgloss.NormalBorder()).
			BorderLeft(true).
			BorderForeground(primaryDarkestColor)
	}
	// Box is the style for surrounding an area.
	Box = func() lipgloss.Style {
		return lipgloss.NewStyle().
			BorderStyle(lipgloss.RoundedBorder()).
			BorderForeground(primaryDarkestColor)
	}
	// FocusBox is the style for surrounding an area with accent.
	FocusBox = func() lipgloss.Style {
		return lipgloss.NewStyle().
			BorderStyle(lipgloss.RoundedBorder()).
			BorderForeground(primaryLightestColor)
	}
)

Functions

func BoolToYN

func BoolToYN(b bool) string

BoolToYN convert a boolean to a stylized yes/no. "yes" being positive.

func BoolToYNColorReverted

func BoolToYNColorReverted(b bool) string

BoolToYNColorReverted convert a boolean to a stylized yes/no. "no" being positive.

func JobStatusStyle

func JobStatusStyle(s string) lipgloss.Style

JobStatusStyle choose the right style for the right status.

func OnError

func OnError(errorStyle lipgloss.Style, v string, err error) string

OnError prints with the error style if the error is not nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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