Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the style configuration #16

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ type Style struct {
}

func DefaultNewsStyle() (s Style) {
s.ActiveStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("62")).BorderForeground(lipgloss.Color("62"))
s.TitleActiveStyle = lipgloss.NewStyle().Background(lipgloss.Color("62")).Foreground(lipgloss.Color("230"))
primaryColor := lipgloss.Color("62")
secondaryColor := lipgloss.Color("230")
normalTitleColor := lipgloss.Color("#DDDDDD")
normalDescColor := lipgloss.Color("#777777")
selectedPrimaryColor := lipgloss.Color("#AD58B4")
selectedSecondaryColor := lipgloss.Color("#EE6FF8")
breakingColor := lipgloss.Color("#FF0000")

s.ActiveStyle = lipgloss.NewStyle().Foreground(primaryColor).BorderForeground(primaryColor)
s.TitleActiveStyle = lipgloss.NewStyle().Background(primaryColor).Foreground(secondaryColor)
s.ListActiveStyle = s.ActiveStyle.Copy().Padding(1, 1, 1, 1).Margin(0, 1, 0, 1).BorderStyle(lipgloss.RoundedBorder())
s.ReaderTitleActiveStyle = func() lipgloss.Style {
b := lipgloss.RoundedBorder()
Expand All @@ -48,7 +56,7 @@ func DefaultNewsStyle() (s Style) {
}()

s.InactiveStyle = lipgloss.NewStyle()
s.TitleInactiveStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("230"))
s.TitleInactiveStyle = lipgloss.NewStyle().Foreground(secondaryColor)
s.ListInactiveStyle = s.InactiveStyle.Copy().Padding(1, 1, 1, 1).Margin(0, 1, 0, 1).BorderStyle(lipgloss.RoundedBorder())
s.ReaderTitleInactiveStyle = func() lipgloss.Style {
b := lipgloss.RoundedBorder()
Expand All @@ -61,28 +69,18 @@ func DefaultNewsStyle() (s Style) {
return s.ReaderTitleInactiveStyle.Copy().BorderStyle(b)
}()

s.ItemNormalTitle = lipgloss.NewStyle().
Foreground(lipgloss.AdaptiveColor{Light: "#1a1a1a", Dark: "#dddddd"}).
Padding(0, 0, 0, 2)
s.ItemNormalTitle = lipgloss.NewStyle().Foreground(normalTitleColor).Padding(0, 0, 0, 2)

s.ItemNormalDesc = s.ItemNormalTitle.Copy().
Foreground(lipgloss.AdaptiveColor{Light: "#A49FA5", Dark: "#777777"})
s.ItemNormalDesc = s.ItemNormalTitle.Copy().Foreground(normalDescColor)

s.ItemSelectedTitle = lipgloss.NewStyle().
Border(lipgloss.NormalBorder(), false, false, false, true).
BorderForeground(lipgloss.AdaptiveColor{Light: "#F793FF", Dark: "#AD58B4"}).
Foreground(lipgloss.AdaptiveColor{Light: "#EE6FF8", Dark: "#EE6FF8"}).
Padding(0, 0, 0, 1)
s.ItemSelectedTitle = lipgloss.NewStyle().Border(lipgloss.NormalBorder(), false, false, false, true).
BorderForeground(selectedPrimaryColor).Foreground(selectedSecondaryColor).Padding(0, 0, 0, 1)

s.ItemSelectedDesc = s.ItemSelectedTitle.Copy().
Foreground(lipgloss.AdaptiveColor{Light: "#F793FF", Dark: "#AD58B4"})
s.ItemSelectedDesc = s.ItemSelectedTitle.Copy().Foreground(selectedPrimaryColor)

s.ItemBreakingTitle = lipgloss.NewStyle().
Foreground(lipgloss.AdaptiveColor{Light: "#FF0000", Dark: "#FF0000"}).
Padding(0, 0, 0, 2)
s.ItemBreakingTitle = lipgloss.NewStyle().Foreground(breakingColor).Padding(0, 0, 0, 2)

s.ItemBreakingDesc = s.ItemBreakingTitle.Copy().
Foreground(lipgloss.AdaptiveColor{Light: "#FF0000", Dark: "#FF0000"})
s.ItemBreakingDesc = s.ItemBreakingTitle.Copy().Foreground(breakingColor)

return s
}
Loading