Skip to content
Discussion options

You must be logged in to vote

Hi! The easiest way to do this is to simply make sure all your styles have the same background. There's a few ways to do it, but what I like to do is make a style with a background color and then spawn new styles off of that.

Here’s a diff to achieve that (and here’s a full example).

diff --git a/main.go b/main.go
index 93d8b73..b1c7db7 100644
--- a/main.go
+++ b/main.go
@@ -8,8 +8,15 @@ import (
 )
 
 var (
+	baseStyle = lipgloss.NewStyle().
+			Background(lipgloss.Color("#424242"))
+	boxStyle = baseStyle.
+			Margin(0, 2).
+			Padding(0, 1).
+			Height(5).
+			Background(lipgloss.Color("#424242"))
 	logoColor = lipgloss.Color("#297bff")
-	boldStyle = lipgloss.NewStyle().Bold(true)
+	bol…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@devversion
Comment options

Answer selected by devversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants