Better align eyebrow and global search#9033
Conversation
| .m-global-search__content { | ||
| right: $margin-half-em; | ||
| } |
There was a problem hiding this comment.
Hmm, this gets a little tricky. First, this is breaking the encapsulation of .m-global-search by reaching into .m-global-search__content from the parent. We'll likely want a BEM modifier for this. Second, the existing positioning accommodates the focus rectangle, whereas setting right to zero clips the rectangle:
This CSS overall is probably due for some layout scrutiny since it's pretty old. We could probably tighten it up with CSS grid, for instance. Do you want to noodle on it, or do you want my help?
|
@anselmbradford, do you want to take a pass at this? It's not a big priority, so no huge rush on this. Agreed that the CSS is due for a rewrite. |
|
On the current site, the "search" and "submit a complaint" link have a | divider, and the right-hand padding of the | appears in the global cta, and the left-hand padding appears in the global search. In f1c1fc3 I moved the left-hand gap of the | to the global cta, and moved the search so it has a flush right-hand side. In the future, we'll want to rewrite the whole header (likely with CSS grid) to remove much of the nesting and margin and positional tweaks. |
|
@anselmbradford, nice, the fix in f1c1fc3 is much cleaner than what I was trying to do. Everything looks good locally. I can't approve since this is my own PR, so this comment will be my official 👍. If you want to approve, I'll merge it in. |
When the global search appears alone in the header (i.e. on the /complaint/ page, where we hide the "Submit a Complaint" global header CTA), it's offset just slightly from the right edge of the container and the phone number in the eyebrow above. This offset has always existed, but it's more noticeable now that the phone number is the only right-aligned element in the eyebrow. This change aligns the right edge of the search button with the right edge of the page when there is no header CTA.
Changes
How to test this PR
no-jsversion of both the /complaint/ page and any other page that has the CTANotes and todos
Checklist