Best Practices
- •Color Profile Detection: Use
lipgloss.ColorProfile()to check if the terminal supports TrueColor (16 million colors), ANSI256, or only 16 colors. - •No-Color Support: Respect the
NO_COLORenvironment variable. If set, uselipgloss.NewRenderer(os.Stderr).SetHasDarkBackground(true)with no colors. - •TTY Detection: Check if
os.Stdoutis a TTY before startingtea.NewProgram. If not (e.g., in a CI/CD pipe), output a simplified plain-text version of the data. - •Unicode Fallbacks: If a user is on a legacy Windows console, provide ASCII fallback characters for borders and spinners.