theme

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrandPrimary   = "#7a8f78"
	BrandSecondary = "#c47a4a"
	BrandNeutral   = "#111518"
)

Brand colors

View Source
const (
	AnsiSuccess   = "82"
	AnsiPreserved = "39"
	AnsiError     = "196"
	AnsiWarning   = "214"
	AnsiInfo      = "39"
	AnsiHint      = "241"
	AnsiCode      = "213"
)

ANSI 256 color codes for maximum terminal compatibility

View Source
const (
	HexPrimary   = "#7A8F78"
	HexSecondary = "#E0A56A"
	HexAccent    = "#8FA888"
	HexInfo      = "#7FA7C8"
	HexPass      = "#7A8F78"
	HexWarn      = "#E0A56A"
	HexFail      = "#C44747"
	HexError     = "#E07070"
	HexMuted     = "#6F767C"
	HexText      = "#E6E8E6"
	HexTextDim   = "#7E8784"
	HexBgDark    = "#1A1D1C"
	HexBgCard    = "#242826"
	HexBgCode    = "#2A2A2A"
	HexBorder    = "#3A3F3C"

	// Visibility (dark terminal optimized)
	HexPublic  = "#2DD4BF" // teal-400 (ox-public-400)
	HexPrivate = "#FBBF24" // amber-400 (ox-warn-400)
)

Hex color constants (dark terminal/theme optimized)

View Source
const (
	HexLightPrimary   = "#5A7558"
	HexLightSecondary = "#B8824A"
	HexLightAccent    = "#4A7A9C"
	HexLightInfo      = "#4A7A9C"
	HexLightPass      = "#5A7558"
	HexLightWarn      = "#B8824A"
	HexLightFail      = "#A33636"
	HexLightError     = "#A33636"
	HexLightMuted     = "#5A6066"
	HexLightText      = "#1A1A1A"
	HexLightTextDim   = "#5A6066"
	HexLightBgLight   = "#F8F8F8"
	HexLightBgCode    = "#F0F0F0"

	// Visibility (light terminal optimized)
	HexLightPublic  = "#0F766E" // teal-700 (ox-public-700)
	HexLightPrivate = "#B45309" // amber-700 (ox-warn-700)
)

Hex color constants (light terminal/theme optimized)

Variables

View Source
var (
	ColorPrimary = compat.AdaptiveColor{
		Light: lipgloss.Color("#4F6A48"),
		Dark:  lipgloss.Color("#7A8F78"),
	}
	ColorSecondary = compat.AdaptiveColor{
		Light: lipgloss.Color("#B87D3A"),
		Dark:  lipgloss.Color("#E0A56A"),
	}
	ColorAccent = compat.AdaptiveColor{
		Light: lipgloss.Color("#3D5437"),
		Dark:  lipgloss.Color("#8FA888"),
	}
	ColorSuccess = compat.AdaptiveColor{
		Light: lipgloss.Color("#4F6A48"),
		Dark:  lipgloss.Color("#7A8F78"),
	}
	ColorWarning = compat.AdaptiveColor{
		Light: lipgloss.Color("#B87D3A"),
		Dark:  lipgloss.Color("#E0A56A"),
	}
	ColorError = compat.AdaptiveColor{
		Light: lipgloss.Color("#A03030"),
		Dark:  lipgloss.Color("#E07070"),
	}
	ColorInfo = compat.AdaptiveColor{
		Light: lipgloss.Color("#5580A0"),
		Dark:  lipgloss.Color("#7FA7C8"),
	}
	ColorDim = compat.AdaptiveColor{
		Light: lipgloss.Color("#6B7580"),
		Dark:  lipgloss.Color("#8F99A3"),
	}

	// Visibility semantic colors (from sageox-mono tokens.css)
	// Public uses teal scale, private uses amber/warn scale
	ColorPublic = compat.AdaptiveColor{
		Light: lipgloss.Color("#0f766e"),
		Dark:  lipgloss.Color("#2dd4bf"),
	}
	ColorPrivate = compat.AdaptiveColor{
		Light: lipgloss.Color("#b45309"),
		Dark:  lipgloss.Color("#fbbf24"),
	}

	// Wordmark two-tone colors (from sageox-design SVGs)
	ColorWordmarkSage = compat.AdaptiveColor{
		Light: lipgloss.Color("#7a8f78"),
		Dark:  lipgloss.Color("#c4d1c0"),
	}
	ColorWordmarkOx = compat.AdaptiveColor{
		Light: lipgloss.Color("#546a54"),
		Dark:  lipgloss.Color("#7a8f78"),
	}
)

Adaptive colors for light/dark terminal detection

View Source
var Tokens = []TokenInfo{
	{"Primary", CategoryBrand, "#4F6A48", "#7A8F78", "App name, headers, spinners — the calm sage anchor"},
	{"Secondary", CategoryBrand, "#B87D3A", "#E0A56A", "Commands, interactive elements — copper highlight"},
	{"Accent", CategoryBrand, "#3D5437", "#8FA888", "File paths, callouts, \"look here\""},

	{"Success", CategorySemantic, "#4F6A48", "#7A8F78", "Passed checks, confirmations"},
	{"Warning", CategorySemantic, "#B87D3A", "#E0A56A", "Cautions, dirty builds, soft warnings"},
	{"Error", CategorySemantic, "#A03030", "#E07070", "Failures, blocked items, hard stops"},
	{"Info", CategorySemantic, "#5580A0", "#7FA7C8", "Flags, links, informational notes"},
	{"Dim", CategorySemantic, "#6B7580", "#8F99A3", "Descriptions, secondary text"},

	{"Public", CategoryVisibility, "#0f766e", "#2dd4bf", "Visible-to-team — teal"},
	{"Private", CategoryVisibility, "#b45309", "#fbbf24", "Personal / not shared — amber"},

	{"WordmarkSage", CategoryWordmark, "#7a8f78", "#c4d1c0", "\"Sage\" half of the ASCII wordmark"},
	{"WordmarkOx", CategoryWordmark, "#546a54", "#7a8f78", "\"Ox\" half of the ASCII wordmark"},
}

Tokens is the authoritative ordered list of every semantic color the CLI exposes. The component catalog uses this to render swatches; docs/design/tokens.md references it as the canonical reference.

Functions

This section is empty.

Types

type TokenCategory added in v0.9.0

type TokenCategory string

TokenCategory groups semantic tokens for catalog rendering.

const (
	CategoryBrand      TokenCategory = "brand"
	CategorySemantic   TokenCategory = "semantic"
	CategoryVisibility TokenCategory = "visibility"
	CategoryWordmark   TokenCategory = "wordmark"
)

type TokenInfo added in v0.9.0

type TokenInfo struct {
	Name     string        // semantic name, matches the Go identifier
	Category TokenCategory // grouping for catalog display
	LightHex string        // hex used in light terminals
	DarkHex  string        // hex used in dark terminals
	UseCase  string        // one-line description
}

TokenInfo is hand-curated metadata about each adaptive color in generated.go: name, intended use, and the hex values for both light and dark mode (the same values lipgloss picks at runtime).

Keep this in sync with internal/theme/generated.go. A drift test could be added that parses generated.go and asserts these hex values match; for now it's a manual contract.

Jump to

Keyboard shortcuts

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