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 ¶
- func Disabled() provenance.Styler
- func Resolve(flag string, out *os.File) provenance.Styler
- type Lipgloss
- func (l *Lipgloss) Arrow() string
- func (l *Lipgloss) Created(s string) string
- func (l *Lipgloss) ErrorMsg(s string) string
- func (l *Lipgloss) Fail(s string) string
- func (l *Lipgloss) Gap(s string) string
- func (l *Lipgloss) GapName(s string) string
- func (l *Lipgloss) Header(s string) string
- func (l *Lipgloss) Hint(s string) string
- func (l *Lipgloss) Key(s string) string
- func (l *Lipgloss) MarkerNew() string
- func (l *Lipgloss) MarkerOverride() string
- func (l *Lipgloss) MarkerRepeat() string
- func (l *Lipgloss) Ok(s string) string
- func (l *Lipgloss) Old(s string) string
- func (l *Lipgloss) Path(s string) string
- func (l *Lipgloss) Service(s string) string
- func (l *Lipgloss) Skipped(s string) string
- func (l *Lipgloss) SourceLabel(s string) string
- func (l *Lipgloss) Value(s string) string
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.