lipgloss.go
This file
Path
style/lipgloss.go
49 lines · 1.4 KiB · Go
Last changed by
chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
History of this fileTake it
1package style23import (4 "charm.land/lipgloss/v2"56 "charm.land/gum/v2/internal/decode"7)89// ToLipgloss takes a Styles flag set and returns the corresponding10// lipgloss.Style.11func (s Styles) ToLipgloss() lipgloss.Style {12 return lipgloss.NewStyle().13 Background(lipgloss.Color(s.Background)).14 Foreground(lipgloss.Color(s.Foreground)).15 BorderBackground(lipgloss.Color(s.BorderBackground)).16 BorderForeground(lipgloss.Color(s.BorderForeground)).17 Align(decode.Align[s.Align]).18 Border(Border[s.Border]).19 Height(s.Height).20 Width(s.Width).21 Margin(parseMargin(s.Margin)).22 Padding(ParsePadding(s.Padding)).23 Bold(s.Bold).24 Faint(s.Faint).25 Italic(s.Italic).26 Strikethrough(s.Strikethrough).27 Underline(s.Underline)28}2930// ToLipgloss takes a Styles flag set and returns the corresponding31// lipgloss.Style.32func (s StylesNotHidden) ToLipgloss() lipgloss.Style {33 return lipgloss.NewStyle().34 Background(lipgloss.Color(s.Background)).35 Foreground(lipgloss.Color(s.Foreground)).36 BorderBackground(lipgloss.Color(s.BorderBackground)).37 BorderForeground(lipgloss.Color(s.BorderForeground)).38 Align(decode.Align[s.Align]).39 Border(Border[s.Border]).40 Height(s.Height).41 Width(s.Width).42 Margin(parseMargin(s.Margin)).43 Padding(ParsePadding(s.Padding)).44 Bold(s.Bold).45 Faint(s.Faint).46 Italic(s.Italic).47 Strikethrough(s.Strikethrough).48 Underline(s.Underline)49}