Skip to content

v6: Vertically center the KeycapHint glyph#4400

Merged
trevor-scheer merged 1 commit into
graphiql-6from
trevor/keycap-vertical-center
Jul 11, 2026
Merged

v6: Vertically center the KeycapHint glyph#4400
trevor-scheer merged 1 commit into
graphiql-6from
trevor/keycap-vertical-center

Conversation

@trevor-scheer

@trevor-scheer trevor-scheer commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The glyph inside a KeycapHint key (, , , , , letters) sat slightly above center. Centering the line box wasn't enough by itself, since these glyphs carry more ink above the baseline than below it.
  • The glyph now renders in its own span with a small translateY nudge, measured against each glyph's actual ink bounds rather than guessed. needed the most help; the rest were already close.

Test plan

  • Open GraphiQL, look at a keycap hint in the top bar (e.g. the run shortcut), and confirm the glyph is vertically centered on the key.
  • In Storybook, view Primitives/KeycapHint (Single, ChordWithModifier, RunShortcut stories) in both dark and light theme and confirm centering holds across the different glyphs.

Refs: #4219

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0668118

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

This PR includes changesets to release 8 packages
Name Type
@graphiql/react Patch
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-collections Patch
@graphiql/plugin-doc-explorer Patch
@graphiql/plugin-explorer Patch
@graphiql/plugin-history Patch
@graphiql/plugin-query-builder Patch
graphiql Patch

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

@trevor-scheer
trevor-scheer marked this pull request as ready for review July 11, 2026 05:11
@trevor-scheer
trevor-scheer merged commit c1c33d0 into graphiql-6 Jul 11, 2026
13 checks passed
@trevor-scheer
trevor-scheer deleted the trevor/keycap-vertical-center branch July 11, 2026 05:11
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