Commit c1c33d0
authored
v6: Vertically center the KeycapHint glyph (#4400)
## 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: #42191 parent 77a6a78 commit c1c33d0
3 files changed
Lines changed: 12 additions & 1 deletion
File tree
- .changeset
- packages/graphiql-react/src/components/keycap-hint
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments