Skip to content

Commit

Permalink
CustomSelectControlV2: keep item checkmark top aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Jul 8, 2024
1 parent 6c434b0 commit 0964d1c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/components/src/custom-select-control-v2/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ export const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`
align-items: center;
margin-inline-start: ${ space( 2 ) };
// Keep the checkmark vertically aligned at the top. Since the item text has a
// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin
// is applied to keep the correct alignment between the text and the checkmark.
align-self: start;
margin-block-start: 2px;
// Since the checkmark's dimensions are applied with 'em' units, setting a
// font size of 0 allows the space reserved for the checkmark to collapse for
// items that are not selected or that don't have an associated item hint.
Expand Down

0 comments on commit 0964d1c

Please sign in to comment.