fix(ui): CSS accessibility fixes for Menu, Select, and RadioGroup (#32983)

* fix(ui): add focus-visible outlines to Menu and Select

Replace the default browser focus-visible outline with a
consistent ring style using the data-focus-visible attribute
on Menu items and Select options.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(ui): add cursor styles to RadioGroup items

Add pointer cursor to radio items and not-allowed cursor
for readonly state.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-02-24 17:28:32 +01:00
committed by GitHub
parent dc81af158f
commit 890935951b
5 changed files with 33 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Fixed focus-visible outline styles for Menu and Select components.
**Affected components:** Menu, Select
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Added proper cursor styles for RadioGroup items.
**Affected components:** RadioGroup
@@ -69,6 +69,15 @@
padding-inline: var(--bui-space-1);
display: block;
&:focus-visible {
outline: none;
}
&[data-focus-visible] {
outline: 2px solid var(--bui-ring);
outline-offset: -2px;
}
&[data-focused] .bui-MenuItemWrapper {
background: var(--bui-bg-neutral-2);
color: var(--bui-fg-primary);
@@ -43,6 +43,7 @@
font-size: var(--bui-font-size-2);
color: var(--bui-fg-primary);
forced-color-adjust: none;
cursor: pointer;
&:before {
content: '';
@@ -103,5 +104,9 @@
background: var(--bui-bg-disabled);
}
}
&[data-readonly] {
cursor: not-allowed;
}
}
}
@@ -143,6 +143,11 @@
gap: var(--bui-space-2);
outline: none;
&[data-focus-visible] {
outline: 2px solid var(--bui-ring);
outline-offset: 2px;
}
&[data-focused]::before {
content: '';
position: absolute;