Help us shape the future of Go! Take the 2026 Go Developer Survey

style

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package style is the ONLY package that imports lipgloss. It provides a lipgloss-backed implementation of provenance.Styler plus the color-decision resolver. Keeping lipgloss isolated here preserves the seam rules: internal/ provenance and cmd depend only on the provenance.Styler interface, never on a styling library, and internal/engine is untouched.

Design notes (verified against lipgloss v1.1.0 / termenv v0.16.0):

  • Per-renderer color profiles ONLY — we never call the global lipgloss.SetColorProfile, so a colored human renderer and a plain (Ascii) JSON renderer coexist safely in one process.
  • FIXED ANSI palette, no lipgloss.AdaptiveColor: adaptive resolution issues a blocking OSC background-color query to the terminal, a hang risk in a print-and-exit CLI. The chosen ANSI-16 colors read on light and dark.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disabled

func Disabled() provenance.Styler

Disabled returns a Styler that always renders plain (Ascii profile). Used for --json and any forced-plain path. It is a SEPARATE renderer from the human one, so forcing JSON plain never mutates the colored renderer.

func Resolve

func Resolve(flag string, out *os.File) provenance.Styler

Resolve builds the Styler for the color decision (spec §5 precedence; the --json/forced-plain rule is handled by the caller using Disabled()):

flag=="never"  → Ascii (plain)
flag=="always" → ANSI256 (forced on, even when piped; NO_COLOR no longer applies
                 because --color is the explicit top-of-precedence override)
flag=="auto"   → NewRenderer(out) auto-detect: termenv handles NO_COLOR,
                 CLICOLOR_FORCE, TTY-gate, and CI-as-non-TTY for free.

out is the stream color is gated on (os.Stdout for human output).

Types

type Lipgloss

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

Lipgloss implements provenance.Styler with a single renderer. Styles are built once at construction so each call is a cheap Render.

func (*Lipgloss) Arrow

func (l *Lipgloss) Arrow() string

func (*Lipgloss) Created

func (l *Lipgloss) Created(s string) string

func (*Lipgloss) ErrorMsg

func (l *Lipgloss) ErrorMsg(s string) string

func (*Lipgloss) Fail

func (l *Lipgloss) Fail(s string) string

func (*Lipgloss) Gap

func (l *Lipgloss) Gap(s string) string

func (*Lipgloss) GapName

func (l *Lipgloss) GapName(s string) string

func (*Lipgloss) Header

func (l *Lipgloss) Header(s string) string

func (*Lipgloss) Hint

func (l *Lipgloss) Hint(s string) string

func (*Lipgloss) Key

func (l *Lipgloss) Key(s string) string

func (*Lipgloss) MarkerNew

func (l *Lipgloss) MarkerNew() string

func (*Lipgloss) MarkerOverride

func (l *Lipgloss) MarkerOverride() string

func (*Lipgloss) MarkerRepeat

func (l *Lipgloss) MarkerRepeat() string

func (*Lipgloss) Ok

func (l *Lipgloss) Ok(s string) string

func (*Lipgloss) Old

func (l *Lipgloss) Old(s string) string

func (*Lipgloss) Path

func (l *Lipgloss) Path(s string) string

func (*Lipgloss) Service

func (l *Lipgloss) Service(s string) string

func (*Lipgloss) Skipped

func (l *Lipgloss) Skipped(s string) string

func (*Lipgloss) SourceLabel

func (l *Lipgloss) SourceLabel(s string) string

func (*Lipgloss) Value

func (l *Lipgloss) Value(s string) string

Jump to

Keyboard shortcuts

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