Keeping the same effective height when switching from search input to detached mode #1270
BedheadFred
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, first time posting in a public repo 🙈
We're currently swapping the search input to detached mode when the window reaches a tablet breakpoint. However, from the .gif below you can see that there's a slight visual oddity — one having to do with the padding around the icon, and another having to do with overall height of the box. I'm focusing this discussion on the height for the time being.
See what i mean (see the height change at tablet and at desktop):
We want the height to be 2.5rem (40px), and we've set
--aa-search-input-height: 2.5rem
. However, this correctly alters the height for the detached version's button, but it measures an effective 42px on the non-detached version, which I believe is due to the following setup:Since
.aa-Form
doesn't have its own height specification (it wraps around two other components that have heights), this results in the borders taking up 2 pixels of real space that cannot be rectified withbox-sizing: border-box
.We can set a
height
directly on theaaForm
class, but ideally would like to change the value of the--aa-search-input-height
property and have that reflect the effective height across both variants.Our workaround right now is to do something like this, to avoid direct class selection:
Would there be an issue with having
height
directly on.aa-Form
?Beta Was this translation helpful? Give feedback.
All reactions