mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
fix(ui): embed vertical padding as content to fix background banding
Lipgloss PaddingTop/PaddingBottom adds raw newlines that don't receive background color styling. Prepend/append newlines to the content string instead so they are part of the styled content and get the background.
This commit is contained in:
@@ -146,10 +146,18 @@ func renderContentBlock(content string, containerWidth int, options ...rendering
|
||||
option(renderer)
|
||||
}
|
||||
|
||||
// Embed vertical padding as content newlines rather than style
|
||||
// PaddingTop/PaddingBottom — lipgloss adds those as raw newlines
|
||||
// that don't receive the background color, causing visible banding.
|
||||
for range renderer.paddingTop {
|
||||
content = "\n" + content
|
||||
}
|
||||
for range renderer.paddingBottom {
|
||||
content = content + "\n"
|
||||
}
|
||||
|
||||
theme := GetTheme()
|
||||
style := lipgloss.NewStyle().
|
||||
PaddingTop(renderer.paddingTop).
|
||||
PaddingBottom(renderer.paddingBottom).
|
||||
PaddingLeft(renderer.paddingLeft).
|
||||
PaddingRight(renderer.paddingRight).
|
||||
Foreground(theme.Text)
|
||||
|
||||
Reference in New Issue
Block a user