Skip to content

[Features] Add missing color tokens to Theme struct #24

@felipeospina21

Description

@felipeospina21

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

  1. Add the 6 new fields to style.Theme in style/theme.go
  2. Update all 7 presets in style/presets.go with appropriate values
  3. 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
  4. Update example app theme

Source

  • Roadmap section: Features
  • Priority: medium
  • Module: tuishell

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions