styles

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package styles defines the visual styling for dodot's terminal output.

All styles use semantic names and adaptive colors that automatically adjust to light and dark terminal themes. This centralized approach ensures consistent theming across all command outputs.

Style names are used as XML-like tags in templates:

<Success>Operation completed</Success>
<Handler>symlink</Handler>

See pkg/output/doc.go for the complete rendering pipeline documentation.

Index

Constants

This section is empty.

Variables

View Source
var StyleRegistry map[string]lipgloss.Style

StyleRegistry maps semantic names to lipgloss styles

Functions

func GetStyle

func GetStyle(name string) lipgloss.Style

GetStyle safely retrieves a style from the registry

func LoadStyles

func LoadStyles(path string) error

LoadStyles loads style configuration from a YAML file

func MergeStyles

func MergeStyles(styles ...string) lipgloss.Style

MergeStyles combines multiple styles

Types

type ColorDef

type ColorDef struct {
	Light string `yaml:"light"`
	Dark  string `yaml:"dark"`
}

ColorDef represents an adaptive color definition in YAML

type Config

type Config struct {
	Colors map[string]ColorDef `yaml:"colors"`
	Styles map[string]StyleDef `yaml:"styles"`
}

Config represents the complete styles configuration

type StyleDef

type StyleDef struct {
	Bold         bool   `yaml:"bold,omitempty"`
	Italic       bool   `yaml:"italic,omitempty"`
	Underline    bool   `yaml:"underline,omitempty"`
	Foreground   string `yaml:"foreground,omitempty"`
	Background   string `yaml:"background,omitempty"`
	Width        int    `yaml:"width,omitempty"`
	Align        string `yaml:"align,omitempty"`
	MarginLeft   int    `yaml:"marginLeft,omitempty"`
	MarginBottom int    `yaml:"marginBottom,omitempty"`
	MarginTop    int    `yaml:"marginTop,omitempty"`
	PaddingLeft  int    `yaml:"paddingLeft,omitempty"`
	PaddingRight int    `yaml:"paddingRight,omitempty"`
}

StyleDef represents a style definition in YAML

Jump to

Keyboard shortcuts

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