Skip to content

Themes that change shapes as well as colours, and menu palettes - #24

Merged
adammharris merged 2 commits into
mainfrom
claude/unit-themes-menu-redesign-anu1mh
Nov 17, 2026
Merged

adammharris merged 2 commits into
mainfrom
claude/unit-themes-menu-redesign-anu1mh

Conversation

@adammharris

@adammharris adammharris commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

Themes cover shape, not just colour. Theme gains a Shape:

  • edges for controls, fields, surfaces and floating panels (menus, dialogs, toasts)
  • the pill radius, and four shadows (control, surface, floating, raised)
  • the menu row inset, the focus-ring width, and heading weight

Metrics gains radius_small and Palette gains field. Every corner, edge and shadow that style.rs wrote in pixels is now a theme property. Pixel values that remain are density decisions, such as row heights.

Three themes ship, listed by Theme::all():

  • Unit: as before.
  • Soft: the look intended for Diaryx. Diaryx's warm neutrals and blue, rounder corners, buttons drawn by fill, fields still edged, and surfaces lifted by shadow.
  • Sharp: square, ruled and flat. Mainly there to show how far shape can go.

Menu palettes. Entry::palette(items) puts a few items side by side in one row, each an icon over a short label. Up and down treat it as one entry, left and right move along it, and assistive tech reads it as a group of menu items. Ticked items show where they stand, so a small choice such as View → Reflow / Pages / Source can sit inline instead of in a submenu. A palette of words alone, with no icons, is a normal row's height and reads as a segmented choice. The gallery's file menu now uses one. Lucide's copy, pencil and shield icons are added.

Gallery. A Theme switcher sits next to Appearance and Density. ?theme=soft on the web, or UNIT_THEME=soft in a window, opens it in that theme.

Audit

A new test, every_theme_fails_only_what_units_own_does, runs the full audit for every theme that ships. It fails any theme that fails a check Unit's own theme passes.

Theme Checks passed
Unit 5149 / 5278
Soft 5230 / 5278
Sharp 5230 / 5278

Soft's dark mode uses a light blue with dark text on it, because no single blue passes as both a fill under white text and a link on a dark ground.

The RadioGroup:Appearance focus-ring entries in the baseline became RadioGroup:Theme. The same known gap applies to the page's first segmented control, and that control is now Theme.

Visible changes in Unit's own theme

  • Menus use radius-large: 10px instead of 8px.
  • Badge text uses accent-text, which is still white in Unit's palettes.
  • Chips are at least a control's height.

Checks

cargo fmt --check, clippy on the workspace and on wasm32 for the web, cargo test --workspace (with the audit), the Blitz tests in dark, and cargo doc with warnings denied all pass. The web gallery was also built and screenshotted in each theme.

adammharris and others added 2 commits November 16, 2026 20:56
…lette

A theme now carries a Shape — the edges of controls, fields, surfaces and
what floats; how round a pill is; the shadows under controls, surfaces,
what floats and what stands up from a groove; how far a menu's rows stand
in; the focus ring; a heading's weight — and a small radius beside the two
corners each density had. Every corner, edge and shadow the stylesheet
wrote in pixels is now one of these properties, so a theme restyles them
all. A field has its own face colour, so a theme can draw buttons by fill
and fields by an edge on a lighter face.

Three themes ship, listed by Theme::all(): Unit, as before; Soft, Diaryx's
warm paper and ink and its blue, rounder, its buttons drawn by fill and its
surfaces lifted by shadow; and Sharp, square, ruled and flat. The audit
now runs over each and fails a theme that fails a cell Unit's own passes:
Soft passes 66 cells Unit fails, Sharp 66 too.

A menu can hold a palette (Entry::palette): a few items side by side in
one row, each an icon over a short label, one entry to the arrows up and
down, walked along by left and right, read as a group of menu items. The
gallery's file menu is one. Lucide's copy and pencil join the icons.

The gallery offers the three themes beside appearance and density, and
opens in one asked for by ?theme= on the web or UNIT_THEME in a window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3EBi6FdGbxA5avpKEF5kL
A palette with no icons, a choice of a few (Reflow, Pages, Source), is an
item's height and reads as a segmented choice, not a block as tall as a
palette of icons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3EBi6FdGbxA5avpKEF5kL
@adammharris
adammharris merged commit d5202fe into main Nov 17, 2026
7 checks passed
@adammharris
adammharris deleted the claude/unit-themes-menu-redesign-anu1mh branch November 17, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant