Skip to content

Commit

Permalink
fix(Input): focus alignment (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikbacker authored Nov 1, 2024
1 parent 9bb2fa6 commit b3fa7a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@

flex-shrink: 0; /* Never shrink a toggle input */
line-height: inherit; /* Inherit line height so we can use 1lh to align with first line of label */
translate: 0 calc((1lh - var(--dsc-input-size)) / 2); /* Align with first line of label text */
width: var(--dsc-input-size);

&:not([aria-label]) {
translate: 0 calc((1lh - var(--dsc-input-size)) / 2); /* Align with first line of <label> text, but not if having aria-label as <label> */
}
}

&[type='radio'] {
Expand Down

0 comments on commit b3fa7a1

Please sign in to comment.