Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/keycap-hint-vertical-center.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphiql/react': patch
---

Vertically center the glyph inside `KeycapHint` keys.
6 changes: 6 additions & 0 deletions packages/graphiql-react/src/components/keycap-hint/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
font-weight: 600;
line-height: 1;
}

.graphiql-keycap-glyph {
/* The glyphs' ink sits slightly above the vertical center of their em
box, so centering the line box alone isn't quite enough. */
transform: translateY(0.05em);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const KeycapHint: FC<KeycapHintProps> = ({ keys, ariaLabel }) => {
<span className="graphiql-keycap-hint" aria-label={ariaLabel}>
{keys.map((k, i) => (
<kbd key={`${k}-${i}`} className="graphiql-keycap">
{display[k] ?? k}
<span className="graphiql-keycap-glyph">{display[k] ?? k}</span>
</kbd>
))}
</span>
Expand Down
Loading