lipgloss icon indicating copy to clipboard operation
lipgloss copied to clipboard

Renderer-level style rules

Open meowgorithm opened this issue 2 years ago • 0 comments

I wonder if it makes any kind of sense for the default renderer to contain default settings that would be inherited by styles belonging from that renderer. The styles themselves could, of course, override those defaults.

r := lipgloss.NewRenderer(os.Stdout)
r.TabWidth(2)
r.Background(lipgloss.Color("#0000FF"))

str1 := r.NewStyle().Render("Hello") // blue background
str2 := r.NewStyle().Background("#FF0000").Render("Hi, again.") // red background

It feels a bit niche, but logging it here as a potential feature regardless.

meowgorithm avatar Jul 24 '23 14:07 meowgorithm