Repository navigation
Themes that change shapes as well as colours, and menu palettes - #24
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Themes cover shape, not just colour.
Themegains aShape:Metricsgainsradius_smallandPalettegainsfield. Every corner, edge and shadow thatstyle.rswrote 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():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'scopy,pencilandshieldicons are added.Gallery. A Theme switcher sits next to Appearance and Density.
?theme=softon the web, orUNIT_THEME=softin 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.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:Appearancefocus-ring entries in the baseline becameRadioGroup: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
radius-large: 10px instead of 8px.accent-text, which is still white in Unit's palettes.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, andcargo docwith warnings denied all pass. The web gallery was also built and screenshotted in each theme.