Primary navigation primary-nav__button-toggle is not vertically center below 1200 res.

Screenshot for reference:

The solution will be:
Add margin-top: auto and margin bottom: auto to primary-nav__button-toggle below 1200 res.

Comments

kiran.kadam911 created an issue. See original summary.

kiran.kadam911’s picture

Status: Active » Needs work
kiran.kadam911’s picture

Issue summary: View changes
kiran.kadam911’s picture

Status: Needs work » Needs review
StatusFileSize
new1.67 KB

Kindly review the attached patch.

Thanks!

gauravvvv’s picture

Plus icon is now aligned centered. Patch #4 fixes the issue.

Moving to RTBC

gauravvvv’s picture

Status: Needs review » Reviewed & tested by the community
mherchel’s picture

Status: Reviewed & tested by the community » Needs work

This is a good catch. When we change this, we also need to change the alignment of the icon for the route:<button> generated buttons (see https://www.drupal.org/node/3053689)

I'm also not really concerned about how well it lines up within the block, but rather if it aligns visually with the text.

To me, we could do something like align-self: center; on the button, and then also give it a small bottom margin to perfectly align it with the text.

Whatever we do, we need to make the same corresponding visual change for the route:<button> generated buttons, though.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB

Providing updated version of patch #8 as per comment #7.

Kindly review the patch,

Thanks

mherchel’s picture

Status: Needs review » Needs work

Thanks for working on this.

We still need to change the alignment of the plus icon for the route:<button> generated buttons (see https://www.drupal.org/node/3053689).

That code is located at https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/themes/olive...

Also be sure to test that the changes in the mobile view do not visually affect the desktop navigation.

javi-er’s picture

StatusFileSize
new2.84 KB

I took a similar approach for aligning both cases as close as possible, I tested it on Chrome, Safari, FF and IE11 to make sure it's consistent.
There is a 1px difference on FF but other than that it should be aligned with the first line of text ( in the case it's more than one link link).
Patch attached (3212073-9.patch)

mherchel’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Needs work

This is looking so much better! I have a couple minor changes:

  1. +++ b/core/themes/olivero/css/components/navigation/nav-primary-button.pcss.css
    @@ -10,7 +10,7 @@
    -  margin-block-start: 2px; /* Visually align button with menu link text. */
    +  margin-block-start: var(--sp0-5);
    

    This is good, but let's keep the /* Visually align button with menu link text. */ comment.

  2. +++ b/core/themes/olivero/css/components/navigation/nav-primary.css
    @@ -25,6 +25,7 @@
    +    align-items: flex-start;
    

    This doesn't appear to be needed. When I remove it in devtools, I don't see any changes.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new2.54 KB

Providing updated version of patch #13 as per comment #12

ranjith_kumar_k_u’s picture

StatusFileSize
new60.63 KB
new57.36 KB

The above patch works fine.
Before patch
before patch

After patch
after patch

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. Thanks for all of the help!

  • lauriii committed 7510304 on 9.3.x
    Issue #3212073 by Sakthivel M, kiran.kadam911, javi-er, Gauravmahlawat,...

  • lauriii committed b47b91b on 9.2.x
    Issue #3212073 by Sakthivel M, kiran.kadam911, javi-er, Gauravmahlawat,...
lauriii’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 7510304 and pushed to 9.3.x. Also cherry-picked to 9.2.x because Olivero is experimental. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.