Description
The current style.Theme struct has 30 color tokens but is missing tokens for several UI elements, forcing consumers to either hardcode colors or reuse semantically wrong tokens. Add 6 new tokens to give apps full control over all visual elements.
New tokens
| Token |
Purpose |
Currently hacked with |
Surface |
Panel/container background |
nothing (transparent) |
BorderFocused |
Active/focused panel border |
Primary or PrimaryBright |
TitleText |
Headings, section titles |
Primary or Info (inconsistent) |
TextAccent |
Secondary emphasis text (links, labels) |
Primary or Border (wrong semantic) |
Highlight |
Selected row/item background |
PrimaryDim (semantic mismatch) |
PopoverBorder |
Popover overlay border |
ModalBorder (reuse) |
Changes required
- Add the 6 new fields to
style.Theme in style/theme.go
- Update all 7 presets in
style/presets.go with appropriate values
- Update tuishell components to use the new tokens:
table/styles.go: use TitleText for TitleStyle, Highlight for selected row background
popover/*.go: use PopoverBorder instead of ModalBorder
shell/update.go / layout.go: use BorderFocused where applicable
- Update example app theme
Source
- Roadmap section: Features
- Priority: medium
- Module: tuishell
Description
The current
style.Themestruct has 30 color tokens but is missing tokens for several UI elements, forcing consumers to either hardcode colors or reuse semantically wrong tokens. Add 6 new tokens to give apps full control over all visual elements.New tokens
SurfaceBorderFocusedPrimaryorPrimaryBrightTitleTextPrimaryorInfo(inconsistent)TextAccentPrimaryorBorder(wrong semantic)HighlightPrimaryDim(semantic mismatch)PopoverBorderModalBorder(reuse)Changes required
style.Themeinstyle/theme.gostyle/presets.gowith appropriate valuestable/styles.go: useTitleTextforTitleStyle,Highlightfor selected row backgroundpopover/*.go: usePopoverBorderinstead ofModalBordershell/update.go/layout.go: useBorderFocusedwhere applicableSource