Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand hover styles on buttons to fill mobile menu #1076

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

millmason
Copy link
Contributor

What

Addresses (issue 977: Hover styling does not span the entire width of menu)[#977].

How

We add the tailwind classes w-full and justify-start (which translate to: width: 100%; and justify-content: start) to all links in the mobile menu. This expands the element to the full width of the mobile menu while keeping the text aligned correctly.

Screenshots

Before:

Screen Shot 2025-01-11 at 10 12 05 AM

After:

Screen Shot 2025-01-11 at 10 15 41 AM

Testing instructions:

View current state

  1. First, go to cleanandgreenphilly.com
  2. View the (live, production) website with screen dimensions wider than 640px, but narrow enough that the mobile (hamburger) menu is available.
  3. Open the dropdown menu by clicking on the hamburger toggle in the nav bar
  4. Observe that the button for the current page is highlighted green
  5. Hover over any of the other buttons. The button should have a darker gray background than un-hovered buttons. The background should completely wrap the content text of the button, but not span the width of the menu as desired.

View proposed changes

  1. Run code locally
  2. Repeat steps 2 through 4 for the local version of the website
  3. Hover over any of the non-active buttons (not highlighted with a green background.) The button should have a darker gray background as in production, but the background should fully extend to fill the mobile menu. The text should remain left-aligned (or right-aligned, if viewed with the browser set to a right-to-left language).

Copy link

vercel bot commented Jan 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vacant-lots-proj ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2025 7:35pm

@CodeWritingCow
Copy link
Collaborator

@millmason thank you for the detailed testing instructions. I just tested your PR. Gray hover styling now spans the mobile nav menu's entire width. Thanks!

@CodeWritingCow CodeWritingCow requested review from bacitracin and removed request for zigouras January 11, 2025 20:11
@CodeWritingCow
Copy link
Collaborator

By the way, I've changed this PR's base branch from main to staging. I'll update this repo's contributors guide to let folks know that generally they should submit PRs against staging branch.

@CodeWritingCow
Copy link
Collaborator

@bacitracin I noticed that on our live website, the mobile nav menu has no hover styling on screens smaller than 640px. That behavior is unrelated to this PR. Do you know whether that's a bug, or if the menu is working as intended?

@bacitracin
Copy link
Collaborator

@CodeWritingCow Hmm at < 640px the mobile menu background color still changes on hover, from the page color to a brighter white. This is the same as at higher widths. So I'd say it's a bug, and the dark grey hover over each option is missing.

Copy link
Collaborator

@bacitracin bacitracin left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for fixing!

@millmason
Copy link
Contributor Author

@bacitracin @CodeWritingCow I don't have write-access to the repo so I can't merge the branch -- should I ping someone to do so? (Not to rush, just making sure I'm not omitting a step!)

@bacitracin bacitracin merged commit c92d061 into CodeForPhilly:staging Jan 13, 2025
5 checks passed
@bacitracin
Copy link
Collaborator

@millmason Nope, no need unless we're being super slow about it. Just merged 👍

@CodeWritingCow
Copy link
Collaborator

@CodeWritingCow Hmm at < 640px the mobile menu background color still changes on hover, from the page color to a brighter white. This is the same as at higher widths. So I'd say it's a bug, and the dark grey hover over each option is missing.

Just created bug ticket #1079 to track this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants