Skip to content

Create bigger targets for Header Nav submenu items#4427

Closed
mahoneycm wants to merge 1646 commits into
uswds:developfrom
mahoneycm:cm-navigation-link-target
Closed

Create bigger targets for Header Nav submenu items#4427
mahoneycm wants to merge 1646 commits into
uswds:developfrom
mahoneycm:cm-navigation-link-target

Conversation

@mahoneycm

@mahoneycm mahoneycm commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

Description

Modeled some of the suggestions in #2836 and #3033 which give subnav menu items a larger targeting area and a visual queue that it is selected, similar to the mobile version.

The desired effect was accomplished by setting the submenu item anchor tag to display: block; and moving the padding from the parent tag to the anchor itself.

I also set the hover state background color to primary from primary-darker to give a highlighted effect.

Additional information

Current Nav menus

image
image

Suggested on #2836
image

After this fix

image
image
The padding being added to the anchor tags does make the mega menu larger compared to before

Fixes #2836

@mahoneycm

Copy link
Copy Markdown
Contributor Author

@mejiaj

@thisisdano

Copy link
Copy Markdown
Contributor

I like the block anchors, but let's remove the highlighting for now. Perhaps it's something we can enable with a setting, but I don't just want to introduce it out of nowhere.

@thisisdano

Copy link
Copy Markdown
Contributor

Let's also look at reducing the padding a bit, feels a bit too generous as-is.

@mejiaj mejiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some suggestions based on @thisisdano's comments.

Comment thread src/stylesheets/components/_navigation.scss Outdated
Comment thread src/stylesheets/components/_navigation.scss Outdated
@mahoneycm

Copy link
Copy Markdown
Contributor Author

Requested changes made and pushed! @mejiaj

@mejiaj mejiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to update the megamenu link offset value in _header.scss. A value of units('neg-05') seems to fix it.

Noticed the following regression when focus is on megamenu links.

Basic with mega-menu
image
image

Extended header with mega-menu
image

@mahoneycm

Copy link
Copy Markdown
Contributor Author

We might want to update the megamenu link offset value in _header.scss. A value of units('neg-05') seems to fix it.

Noticed the following regression when focus is on megamenu links.

Basic with mega-menu image image

Extended header with mega-menu image

Fixed in commit 4cea191. Note that I had to add this to _navigation.scss to get it to work. Not _header.scss

@thisisdano thisisdano changed the title USWDS - Navigation: Modified submenu anchor targeting Create bigger targets for Header Nav submenu items May 8, 2022
USWDS - Repair uswds-init load flashing
@thisisdano

Copy link
Copy Markdown
Contributor

@mahoneycm Looks like this just needs some merge conflict resolution and we're good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase target area of header menu dropdown links on desktop sizes

8 participants