Skip to content

v6: Restyle Button and ToolbarButton#4276

Merged
trevor-scheer merged 3 commits into
graphiql-6from
trevor/restyle-button-iconbutton
May 15, 2026
Merged

v6: Restyle Button and ToolbarButton#4276
trevor-scheer merged 3 commits into
graphiql-6from
trevor/restyle-button-iconbutton

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented May 15, 2026

Summary

  • Migrate Button, UnStyledButton, ToolbarButton, and ExecuteButton CSS to v6 OKLCH tokens.
  • Add variant?: 'default' | 'primary' to Button; primary renders the Run-button style.
  • Switch :focus to :focus-visible on interactive states so the focus ring no longer fires on mouse click. Aligns with MDN :focus-visible and WCAG 2.4.7 (Focus Visible).
  • Import clsx directly in button and toolbar-button, following the leaf-module pattern from Import directly from leaf modules in graphiql-react to fix Rollup chunk cycles #4272. A follow-up PR will convert remaining callers and remove the cn re-export.
  • Add Storybook stories: Primitives/Button (Default, Primary, Success, Error, Disabled) and Primitives/ToolbarButton (Default).

Test plan

  • Open Storybook Primitives/Button and verify each variant matches the design.
  • Tab into the buttons, then mouse-click them. Focus ring appears on Tab only, not on click.
  • Open Primitives/ToolbarButton. Hover the icon button; a v6 tooltip appears.
  • Run yarn dev:graphiql. The Run button and toolbar buttons match the new design.

Refs: #4219

Migrates button component CSS to v6 OKLCH tokens and adds a `primary`
variant to `Button` for the Run-button style (green fill, white text,
weight 600). Execute-button CSS updated to match. Storybook stories
added covering default, primary, success, error, and disabled states.
Props and runtime behavior unchanged.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

🦋 Changeset detected

Latest commit: f5394a8

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Add `autodocs` to custom-words.txt
- Convert `Button` stories to render functions so the `.tsx` file
  contains JSX (oxlint rule)
- Use opaque accent colors with white text on the `success` and
  `error` variants so they meet WCAG AA contrast
@github-actions
Copy link
Copy Markdown
Contributor

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@trevor-scheer trevor-scheer marked this pull request as ready for review May 15, 2026 06:08
@trevor-scheer trevor-scheer merged commit bd773d3 into graphiql-6 May 15, 2026
13 checks passed
@trevor-scheer trevor-scheer deleted the trevor/restyle-button-iconbutton branch May 15, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant