Skip to content

Commit

Permalink
fix(examples): base col widths on page width
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Dec 2, 2024
1 parent e2c9285 commit e0aa9f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/layout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ var (
list = lipgloss.NewStyle().
Border(lipgloss.NormalBorder(), false, true, false, false).
BorderForeground(subtle).
MarginRight(2).
MarginRight(1).
Height(8).
Width(columnWidth + 1)
Width(width / 3)

listHeader = base.
BorderStyle(lipgloss.NormalBorder()).
Expand All @@ -152,7 +152,6 @@ var (
}

// Paragraphs/History.

historyStyle = lipgloss.NewStyle().
Align(lipgloss.Left).
Foreground(lipgloss.Color("#FAFAFA")).
Expand Down Expand Up @@ -282,7 +281,7 @@ func main() {
listItem("Pomelo"),
),
),
list.Width(columnWidth).Render(
list.Render(
lipgloss.JoinVertical(lipgloss.Left,
listHeader("Actual Lip Gloss Vendors"),
listItem("Glossier"),
Expand All @@ -294,7 +293,7 @@ func main() {
),
)

doc.WriteString(lipgloss.JoinHorizontal(lipgloss.Top, lists, colors))
doc.WriteString(lipgloss.JoinHorizontal(lipgloss.Top, lists, lipgloss.NewStyle().MarginLeft(1).Render(colors)))

// Marmalade history
{
Expand Down

0 comments on commit e0aa9f6

Please sign in to comment.