Background
Currently, the visual distinction between selected and unselected menu items is not enough. Selected menu items use the background-color-progressive-subtle (light blue) that could not be contrasted enough with the white background of unselected items, making it difficult for users, especially those with visual impairments, to discern the selection. Additionally, there are no visual distinction between single-select and multi-select menus.
We need to improve the visual differentiation of selected menu items to improve their scannability, and accessibility.
Considerations
We need to make sure that this new solution works fine with any menu, even those containing commands at the end.
Design spec
To reinforce selection, the following elements would be included in the selected menu-item:
- The @color-progressive will be used for labels and icons within the selected menu-item, both single-select and multi-select menus.
- A 16px check icon as end icon within the menu-item. This will be included as a configurable property to show/hide according to different menus. It will be visible by default in multi-select menus while it will not be visible in single-select menus.
So we will use the following selection indicators:
- Single-selection: blue background (current) + blue text (new)
- Multi-selection: blue background + blue text + check icon (this icon will serve as a clear indicator to differentiate the multi-selection from the single-selection)
This approach effectively differentiates menu types, making it easier for users to understand when multi-selection is available.
New menu-item styles
These would be the new menu-item styles proposed, which would make the menu-item selected more prominent as well as will be better aligned with other components such as Accordion (where we use these hover and active bg color styles):
- Default: it will remain the same as it is now
- Hover: update the background to @background-color-interactive-subtle and the text/icon to @color-base--hover
- Active: update the background to @background-color-interactive and the text/icon to @color-emphasized
- Selected: the bg color will remain @background-color-progressive-subtle and the text/icon will update to @color-progressive
- Selected Hover: the bg color will remain @background-color-progressive-subtle and the text/icon will update to @color-progressive--hover
- Selected Active: we will implement this new selected-active state using @background-color-progressive-subtle and @color-progressive--active
- Disabled: it will remain the same as it is now
Implementation
- Menu items in single select menus should get the updated colors when selected, as described above
- Menu items in multi-select menus should get the updated colors AND should display the checkbox icon to the right for each selected item
Acceptance criteria (or Done)
Design
- Design the Figma spec sheet and add it in this task
- Update the component in the Figma library. This step will be done by a DST member.
- Update the MenuItem Guidelines in Codex
Code
- Update the styles of the MenuItem states as described above