Skip to content

Radii #63703

@jameskoster

Description

@jameskoster
radius

Recent work has expanded the values used for border radius in the UI. Specifically; the new menu component, document title, and command palette all make use of a larger 4px radius. The preview / content frame, and modal radius is larger still: 8px.

A defined scale for radius can add polish to the UI. For example compare how menu items nest neatly inside their container in the new menu component, compared with the current one:

DropdownMenu V2 DropdownMenu
Screenshot 2024-07-11 at 16 32 17 Screenshot 2024-07-11 at 16 32 26

Ad hoc proliferation of values for radius is going to create a maintenance headache down the road, so it would be good to think systematically about a refreshed radius scale, and semantic application thereof.

Radius scale

radius2

Members of the design team have been looking into this and formulated the following scale/guidelines:

  • $radius-x-small: The smallest radius. Applied to contained elements within primitives like inputs or buttons. E.g. the selected item in a ToggleGroupControl, or the unit selector in UnitControl.
  • $radius-small: Applied to primitive components like Badges, Buttons, Inputs, Checkboxes.
  • $radius-medium: Applied to containers with smaller padding, e.g. Menus, Notices, Snackbars, Block toolbar. Also used for focus rings on primitive components.
  • $radius-large: Applied to containers with larger padding, e.g. Modals, Pages, and the Preview Frame.
  • $radius-full: For creating lozenges.
  • $radius-round: For creating circles or ovals. (This variable already exists).

Note: The values assigned to each item in the scale can be decided separately, but we can discuss those here too.

Implementation

Once we find consensus around the scale and values, a possible implementation plan might look like:

Metadata

Metadata

Assignees

Labels

Design SystemIssues related to the system of combining components according to best practices.Needs Design FeedbackNeeds general design feedback.[Package] Components/packages/components[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Status

Done

Status

💫 Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions