Skip to content

Commit 7123fd6

Browse files
v6: Give the tab close button hover and focus states (#4420)
## Summary The tab close button (`.graphiql-tab-close`) only changed text color on hover: no background, no rounded corners, no transition, and no `:focus-visible` outline. It's a keyboard-focusable button, so tabbing to it left no visible focus indicator at all. That's an accessibility gap, and it was the one icon button in the app that didn't match the hover/focus pattern used everywhere else: the activity rail, toolbar buttons, and the dialog close button. It now follows that same pattern. ## Test plan - [x] Open several editor tabs, keyboard-Tab to a tab's close (✕) button, and confirm it shows a clear blue focus ring. - [x] Hover the close button and confirm a subtle background appears behind it with rounded corners. - [x] Click the close button and confirm the tab still closes as before. - [x] Check both Dark and Light themes. The hover background and focus ring should be legible in each. Refs: #4219
1 parent 5890bf3 commit 7123fd6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • packages/graphiql-react/src/components/tabs

packages/graphiql-react/src/components/tabs/index.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
padding: var(--px-4);
9090
color: oklch(var(--fg-muted));
9191
line-height: 0;
92+
border-radius: var(--radius-sm);
93+
transition:
94+
color 120ms ease,
95+
background 120ms ease;
9296

9397
& > svg {
9498
height: var(--icon-size-sm);
@@ -97,6 +101,12 @@
97101

98102
&:hover {
99103
color: oklch(var(--fg-default));
104+
background: oklch(var(--bg-overlay));
105+
}
106+
107+
&:focus-visible {
108+
outline: 2px solid oklch(var(--accent-blue));
109+
outline-offset: 2px;
100110
}
101111
}
102112

0 commit comments

Comments
 (0)