Skip to content

feat(kit): the radio control is flat when not selected, and takes a surface - #2198

Merged
Hona merged 1 commit into
devfrom
kit/radio-flat
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
kit/radio-flat

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

rune-kit's radio control follows @opencode/ui's new look (anomalyco/opencode#66108): a control that is not selected is flat, and a group can put its controls on layer 1.

Why

@opencode/ui redrew the radio as Figma has it (forms/radio/radio.css and radio.tsx at a44675ecee). The kit's RadioItem still drew the old one: a 6% top light on every control, the invalid ring in the danger border colour, and a selected dot with no gradient.

What changes

Part Before After
A control that is not selected c.bg_base with a 6% top light Flat: its surface, no top light
The surface Always c.bg_base RadioGroup::surface / RadioItem::surface: RadioSurface::Base (c.bg_base, the default) or RadioSurface::Layer1 (c.layer_01)
The invalid ring c.danger.border c.danger.fg
The selected dot Flat c.knob_on, a ring in the depth highlight, its own 0.5 px drop The depth gradient over c.knob_on, a ring in c.icon_contrast, elevation.elements as its drop
  • The surface is the fill of a control that is neither selected nor invalid. A selected control keeps the accent and an invalid one the danger background on either surface, as in official's CSS.
  • Official moved the hover from a background layer to an inset shadow under the ring. That paints the same pixels as the kit's hover overlay, so the hover is unchanged apart from the top light it no longer covers.
  • kit-gallery gains ui-radio--surfaces, the story official added.

What it can change for an app

Every RadioItem that is not selected loses its top light, and every selected dot gets the new ring and gradient, with no call change. The dot's drop is the same in the OpenCode theme and the neutral kit (elevation.elements holds the value that was written out here); a kit built with an empty elements draws no drop. Sizes, spacing, focus ring and hit targets are unchanged.

Run

  • Tests, Windows x64: cargo test -p rune-kit on this branch: every suite green (156, 48, 294 and 145 passed; 0 failed; 3 ignored), the new radio_look::a_radio_is_flat_on_its_surface_and_an_invalid_one_rings_in_the_danger_foreground among them.
  • Pictures: the gallery's radio stories rendered headless at 2x, in dark and light, on this branch and on dev at 36a50e613 (three commits before this branch's base; none of them touches the radio), then compared pixel by pixel. Every difference lies in the column of controls.
Story Theme Pixels that differ Where
ui-radio--states dark 3,130 the controls (the top light gone, the invalid ring, the dot)
ui-radio--states light 758 the invalid ring and the dots
ui-radio--basic dark 1,764 the controls
ui-radio--basic light 124 the selected dot only

In light a control that is not selected looks as it did: its top light was white over a white base.

Before and after, dark, with a control that is not selected, a selected one and an invalid one at 6x:

The radio states in dark, before and after

Light:

The radio states in light, before and after

The new ui-radio--surfaces story (base on the left, layer 1 on the right):

The two surfaces in dark
The two surfaces in light

Not run

  • macOS and Linux: this repository's scheduled macOS tests run after the merge.
  • No picture of official's own Storybook story was taken to lay beside these; the look is from its CSS.

Not changed

Two differences from official that this commit did not introduce stay as they were (read in the source, not run): a selected control shows no hover overlay while the pointer is over it, and the hover follows the 16 pt control, not the whole item with its label.

…urface

@opencode/ui's radio (anomalyco/opencode#66108): no top light on a control that is not selected, the invalid ring in the danger foreground, the selected dot with the depth gradient, the contrast icon's ring and the small elements' drop, and a surface (base or layer 1) for the fill of a control that is neither selected nor invalid.
@Hona
Hona marked this pull request as ready for review November 25, 2026 08:11
@Hona
Hona merged commit fe1f100 into dev Nov 25, 2026
2 checks passed
@Hona
Hona deleted the kit/radio-flat branch November 25, 2026 08:11
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