Skip to content

feat: a data-driven style system #81

Closed

Description

@octalide

What

Make blit stylable end to end, the way Dear ImGui's style stack is, but data-driven. The theme today is one flat record of colours and metrics shared by every widget, with one pad that serves both container padding and control text inset.

Themes are TOML read and written through std.data.toml, the same format the state store (#95) persists in, rather than a format of blit's own.

Acceptance

  • A per-widget style record for every widget kind (button, toggle, slider, field, section, window, tab, scrollbar, list, chart, tooltip, menu, overlay, modal), with state variants: normal, hot, active, on, disabled, focused
  • Each style covers fill, text colour, border colour and width, corner radii, padding (split into container padding and control inset), margins, min sizes, gradient and shadow, drawn with the primitives from feat: vector draw primitives #79
  • A push/pop style stack that overrides any field for a scope, and named style classes a caller can apply to a widget call
  • Themes load from TOML, with every field addressable, and reload at runtime without rebuilding
  • Built-in themes: dark, light, high contrast, and the current look as the default
  • A theme editor widget built from blit itself, editing a live theme and writing it out
  • Theme fields are documented in one table that is the source of truth

Activity

  1. added
    minorBackwards-compatible new feature or capability
    featureNew capability or feature addition
    on Oct 1, 2026
  2. added 10 commits that reference this issue on Oct 1, 2026
  3. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew capability or feature additionminorBackwards-compatible new feature or capability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions