Skip to content

Commit

Permalink
Clean up the style configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zMoooooritz committed Nov 5, 2023
1 parent b5da116 commit d400a09
Showing 1 changed file with 18 additions and 20 deletions.
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
}

0 comments on commit d400a09

Please sign in to comment.