Documentation
¶
Overview ¶
Package stylex provides styles for the tools commands. This is a separate package to avoid import cycles between the tools commands.
It defines a bunch of lipgloss styles that can be used across the tools commands to ensure a consistent look and feel. It will automatically disable styling if the output is not a TTY, so that the tools can be used in scripts without worrying about ANSI escape codes.
You have nothing to do to activate that.
Index ¶
- Variables
- func ConnectionActive(str string) string
- func ConnectionActivef(format string, a ...any) string
- func ConnectionClosed(str string) string
- func ConnectionClosedf(format string, a ...any) string
- func ConnectionError(str string) string
- func ConnectionErrorf(format string, a ...any) string
- func ConnectionOrphan(str string) string
- func ConnectionOrphanf(format string, a ...any) string
- func Dim(str string) string
- func Dimf(format string, a ...any) string
- func DisableColors()
- func Error(str string) string
- func Errorf(format string, a ...any) string
- func Header(str string) string
- func Headerf(format string, a ...any) string
- func Label(str string) string
- func Labelf(format string, a ...any) string
- func Note(str string) string
- func Notef(format string, a ...any) string
- func Separator(count int) string
- func Success(str string) string
- func Successf(format string, a ...any) string
- func Title(str string) string
- func Titlef(format string, a ...any) string
- func Value(str string) string
- func Valuef(format string, a ...any) string
- func Warn(str string) string
- func Warnf(format string, a ...any) string
Constants ¶
This section is empty.
Variables ¶
var ( // Styling for output - colors only enabled if terminal is TTY IsTTY = isatty.IsTerminal(os.Stdout.Fd()) TitleStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("12")) HeaderStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("14")) NoteStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("238")).Italic(true) DimStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) LabelStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("245")) ValueStyle = lipgloss.NewStyle().Bold(true) SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10")) // Green WarnStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("208")) // Orange ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9")) // Red ConnectionActiveStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("11")) // Yellow ConnectionClosedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10")) // Green ConnectionOrphanStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("13")) // Magenta ConnectionErrorStyle = ErrorStyle )
Functions ¶
func ConnectionActive ¶
ConnectionActive is a helper function equivalent to ConnectionActive.Render(...)
func ConnectionActivef ¶
ConnectionActivef is a helper function equivalent to ConnectionActive.Render(fmt.Sprintf(...))
func ConnectionClosed ¶
ConnectionClosed is a helper function equivalent to ConnectionClosed.Render(...)
func ConnectionClosedf ¶
ConnectionClosedf is a helper function equivalent to ConnectionClosed.Render(fmt.Sprintf(...))
func ConnectionError ¶
ConnectionError is a helper function equivalent to ConnectionError.Render(...)
func ConnectionErrorf ¶
ConnectionErrorf is a helper function equivalent to ConnectionError.Render(fmt.Sprintf(...))
func ConnectionOrphan ¶
ConnectionOrphan is a helper function equivalent to ConnectionOrphan.Render(...)
func ConnectionOrphanf ¶
ConnectionOrphanf is a helper function equivalent to ConnectionOrphan.Render(fmt.Sprintf(...))
func DisableColors ¶
func DisableColors()
Types ¶
This section is empty.