Skip to content

Motion: a theme times its changes, and overlays come and go - #25

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

adammharris merged 1 commit into
mainfrom
claude/unit-themes-menu-redesign-anu1mh

Conversation

@adammharris

Copy link
Copy Markdown
Member

What

A theme says how it moves. Theme gains a Motion: durations for a small change, an appearance and a going, and their curves. Easing is a cubic-bezier(), or a spring drawn with linear().

  • Unit: quick, and settles without a bounce.
  • Soft: longer, on a spring that passes its mark and comes back.
  • Sharp: short and straight, a fade with no growing.

What moves:

  • Small changes in place ease between their looks: hover, press, a chip or tab chosen, a checkbox filling. A switch's knob now slides across instead of jumping. A menu row still lights at once, as a system menu's does.
  • Overlays appear: menus, dialogs, action sheets, modals and toasts grow or rise into place, and a scrim fades in.
  • Overlays leave: a closed menu and a dismissed toast are drawn leaving, with no pointer events and hidden from assistive tech, then taken away. The timer is the host's sleep, or the browser's own timer on the web. Whatever reads the page sees them gone at once.

Staying still: MotionSetting on the root (System, Full, Reduced) keeps a page still where the system's prefers-reduced-motion or the host asks. A host on Blitz, where no media query reports the system's setting, passes it explicitly. A terminal's cells never move.

Blitz

Blitz runs CSS transitions and keyframes on its own clock. One finding: its Stylo only draws the in-between frames of a keyframe animation that names both its ends; a from-only keyframe jumps at the end. So every keyframe here names both, and the style.rs header says so.

Tests

  • The gallery's test pages (GallerySized, GalleryAt) are still by default, because a test's clock stands at 0: anything that moved would stay at its first frame.
  • Two new Blitz tests turn motion on and step the clock. One checks a menu's opacity going 0 → partway → 1, then a leaving copy fading after it closes and being removed. The other checks a toast sinking away and being removed.
  • Full gate passes: cargo fmt --check, clippy (native and wasm32 web), cargo test --workspace with the audit for all three themes, the Blitz tests in dark, and cargo doc with warnings denied.

Gallery

A Motion control sits beside Theme, Appearance and Density. ?motion=full|reduced sets it on the web, and UNIT_MOTION in a window.

For Diaryx, later

  • Pass MotionSetting from the system's Reduce Motion on iOS and macOS.
  • Leaving overlays need a host sleep (Unit::set_timer); without one they go at once, as before.

Generated by Claude Code

A theme carries a Motion: how long a small change, an appearance and a
going take, and the curves they follow (a cubic-bezier, or a spring drawn
as linear()). Unit's is quick and settles; Soft's is longer, on a spring
that passes its mark and comes back; Sharp's is short and straight.

- Small changes in place ease between their looks: a hover, a press, a
  chip or a tab chosen, a checkbox filling. A switch's knob slides across
  rather than jumping. A menu's row still lights at once.
- Menus, dialogs, action sheets, modals and toasts grow or rise into
  place, a scrim fades in. A closed menu and a dismissed toast are drawn
  going, where no pointer reaches them and nothing reads them, and then
  taken away: by the host's sleep, or a browser's own timer.
- MotionSetting on the root (System, Full, Reduced) keeps a page still
  where the system's prefers-reduced-motion or the host asks; a
  terminal's cells never move.

Blitz runs the transitions and keyframes on its own clock. Its Stylo draws
the frames between only for keyframes that name both their ends, so every
keyframe does. The gallery offers Motion beside the others (?motion= on the
web, UNIT_MOTION in a window); its test pages are still, as a test's clock
stands at 0, and two Blitz tests step the clock through a menu's coming and
going and a toast's.
@adammharris
adammharris merged commit c82235d into main Nov 17, 2026
7 checks passed
@adammharris
adammharris deleted the claude/unit-themes-menu-redesign-anu1mh branch November 17, 2026 04:45
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