Repository navigation
feat(kit): the radio control is flat when not selected, and takes a surface - #2198
Merged
Merged
Conversation
…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.
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.
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/uiredrew the radio as Figma has it (forms/radio/radio.cssandradio.tsxata44675ecee). The kit'sRadioItemstill 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
c.bg_basewith a 6% top lightc.bg_baseRadioGroup::surface/RadioItem::surface:RadioSurface::Base(c.bg_base, the default) orRadioSurface::Layer1(c.layer_01)c.danger.borderc.danger.fgc.knob_on, a ring in the depth highlight, its own 0.5 px dropc.knob_on, a ring inc.icon_contrast,elevation.elementsas its dropui-radio--surfaces, the story official added.What it can change for an app
Every
RadioItemthat 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.elementsholds the value that was written out here); a kit built with an emptyelementsdraws no drop. Sizes, spacing, focus ring and hit targets are unchanged.Run
cargo test -p rune-kiton this branch: every suite green (156, 48, 294 and 145 passed; 0 failed; 3 ignored), the newradio_look::a_radio_is_flat_on_its_surface_and_an_invalid_one_rings_in_the_danger_foregroundamong them.devat36a50e613(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.ui-radio--statesui-radio--statesui-radio--basicui-radio--basicIn 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:
Light:
The new
ui-radio--surfacesstory (base on the left, layer 1 on the right):Not run
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.