style

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: BlueOak-1.0.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package style provides consistent terminal output styling for gh-stack. It follows GitHub CLI color conventions and respects NO_COLOR and TTY detection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Style

type Style struct {
	// contains filtered or unexported fields
}

Style provides methods for styling terminal output. All methods return plain text when colors are disabled.

func New

func New() *Style

New creates a new Style instance. Colors are automatically enabled/disabled based on terminal capabilities.

func NewWithColor

func NewWithColor(enabled bool) *Style

NewWithColor creates a Style with explicit color setting. Useful for testing or forcing color on/off.

func (*Style) Bold

func (s *Style) Bold(t string) string

Bold styles text with bold weight.

func (*Style) Boldf

func (s *Style) Boldf(format string, args ...any) string

Boldf styles formatted text with bold weight.

func (*Style) Branch

func (s *Style) Branch(t string) string

Branch styles branch names (cyan).

func (*Style) Branchf

func (s *Style) Branchf(format string, args ...any) string

Branchf styles formatted branch names (cyan).

func (*Style) Enabled

func (s *Style) Enabled() bool

Enabled returns whether colors are enabled.

func (*Style) Error

func (s *Style) Error(t string) string

Error styles text for error messages (red).

func (*Style) Errorf

func (s *Style) Errorf(format string, args ...any) string

Errorf styles formatted text for error messages (red).

func (*Style) FailureIcon

func (s *Style) FailureIcon() string

FailureIcon returns the failure icon (✗) in red.

func (*Style) FailureMessage

func (s *Style) FailureMessage(msg string) string

FailureMessage formats a complete failure message with icon. Example: "✗ Operation failed"

func (*Style) Merged

func (s *Style) Merged(t string) string

Merged styles merged PR references (magenta).

func (*Style) Mergedf

func (s *Style) Mergedf(format string, args ...any) string

Mergedf styles formatted merged PR references (magenta).

func (*Style) Muted

func (s *Style) Muted(t string) string

Muted styles secondary/hint text (gray).

func (*Style) Mutedf

func (s *Style) Mutedf(format string, args ...any) string

Mutedf styles formatted secondary/hint text (gray).

func (*Style) Success

func (s *Style) Success(t string) string

Success styles text for success messages (green).

func (*Style) SuccessIcon

func (s *Style) SuccessIcon() string

SuccessIcon returns the success icon (✓) in green.

func (*Style) SuccessMessage

func (s *Style) SuccessMessage(msg string) string

SuccessMessage formats a complete success message with icon. Example: "✓ Operation complete"

func (*Style) Successf

func (s *Style) Successf(format string, args ...any) string

Successf styles formatted text for success messages (green).

func (*Style) Warning

func (s *Style) Warning(t string) string

Warning styles text for warning messages (yellow).

func (*Style) WarningIcon

func (s *Style) WarningIcon() string

WarningIcon returns the warning icon (!) in yellow.

func (*Style) WarningMessage

func (s *Style) WarningMessage(msg string) string

WarningMessage formats a complete warning message with icon. Example: "! Something might be wrong"

func (*Style) Warningf

func (s *Style) Warningf(format string, args ...any) string

Warningf styles formatted text for warning messages (yellow).

Jump to

Keyboard shortcuts

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