Skip to content

Rework main navigation menu - #931

Open
gellowg wants to merge 42 commits into
mainfrom
reorganise-main-menu
Open

gellowg wants to merge 42 commits into
mainfrom
reorganise-main-menu

Conversation

@gellowg

@gellowg gellowg commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR reorganises and redesigns the main navigation to make important pages easier to find while keeping the menu compact. It also improves keyboard, screen-reader and mobile behaviour, and ensures the shared navigation works with the standard, Freshers and Ball visual themes.

Changes

Navigation structure

  • Keeps Freshers, Events, News, Sponsor and Committee as top-level links
  • Adds an About dropdown containing:
    • Overview
    • Merch
    • Links
  • Adds a separate Join CSS link to the membership page
  • Makes Join CSS a CTA with an accent underline
  • Removes Ball from the main navigation
  • Adds links for the 2020–2026 Ball pages to the Ball card on the Events page
  • Makes all headers sticky

Desktop navigation

  • Makes the header sticky and gives it a larger height
  • Uses semantic, labelled navigation landmarks and list-based menu markup to improve SEO and accessibility
  • Replaces non-navigating dropdown links with buttons
  • Adds accessible dropdown indicators and associates each button with its submenu using ARIA attributes
  • Supports opening dropdowns by pointer, keyboard focus and button activation
  • Keeps the active state visible while a dropdown is open
  • Closes dropdowns when focus leaves, the user clicks elsewhere or presses Escape
  • Returns keyboard focus to the dropdown button after closing with Escape
  • Adds a 300ms pointer-leave delay to prevent dropdowns closing accidentally
  • Redesigns dropdown menus
  • Replaces the previous hover animation with purple bracket indicators
  • Adds visible keyboard focus styling

Mobile navigation

  • Presents the menu as a full-width panel that slides down from behind the sticky header
  • Keeps the CSS logo and menu control visible while the menu is open
  • Prevents the page behind the menu from scrolling while allowing long menu content to scroll
  • Uses a hamburger and cross icon that transition when the menu is opened or closed
  • Updates the menu button’s accessible label and expanded state
  • Allows the menu to be closed with Escape and returns focus to the menu button
  • Automatically closes the mobile menu when the viewport changes to the desktop layout
  • Parent headings are now semantic buttons
  • Opens only one mobile dropdown at a time
  • Keeps ARIA expanded states synchronised with the visible dropdown
  • Left-aligns menu items and indents nested links
  • Removes decorative separator lines and dashes from items
  • Uses larger, evenly spaced menu rows with full-width hover, focus and active states
  • Applies the same hover brackets as used by the desktop navigation
  • Uses a smaller dropdown indicator suited to the mobile text size

Feedback

  • Menu feels too compact
  • Review dropdown menu interaction (Jacob - e.g. societies dropdown should link to about)
  • Dropdown staying open after clicking and moving to another dropdown on desktop bug
  • Review Join CSS button design
  • Review chevron design

Changed a tags to button tags as dropdown titles no longer navigate to pages,
got rid of additional item for mobile dropdowns for same reason
openning a new dropdown closes others on mobile
Dropdown buttons identify the menu they control,
Added aria
JavaScript updates aria-expanded whenever a mobile dropdown changes
Fixed hamburger menu from filling the whole navbar
Mobile menu closes if viewport crosses above 1050px (when desktop)
@gellowg
gellowg requested a review from a team as a code owner September 4, 2026 11:37
@github-actions github-actions Bot added the sync Keep this pr up to date with it's base branch automatically label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

This pull request has been marked to automatically sync to its base branch. You can disable this behavior by removing the label.

@cssbhamdev
cssbhamdev enabled auto-merge (squash) September 4, 2026 11:37
@gellowg
gellowg marked this pull request as draft September 4, 2026 11:39
auto-merge was automatically disabled September 4, 2026 11:39

Pull request was converted to draft

gellowg and others added 17 commits September 8, 2026 00:06
Update navigation to use nav landmarks and list-based markup for desktop and mobile layouts.
Represent dropdown contents as nested lists so for accessibility reasons (makes the relationship between categories and their links clear)
Remove the rule that stops outlines from mobile navigation links so keyboard users can identify the currently focused item. Specified the outline style for high contrast with the current dark background.
Satisfies WCAG 2.4.7 Focus Visible
Keep pointer hover as an optional way to reveal dropdown links. Toggle each dropdown through its native button so click, touch, Enter, and Space work without hover. Close open dropdowns with Escape or an outside pointer action, return focus to the dismissed trigger, and keep the visual state synchronized with aria-expanded.
Wait 300 milliseconds before closing a hover-opened submenu after the pointer leaves. Cancel the pending timer when the pointer returns, the dropdown closes another way, or keyboard focus remains inside.
Change ball card css to accommodate extra line on wider screens
Remove Calendar from events dropdown as it is on events page
…eperator lines, added hover state with animation, reduce freshers graphic size
… allow menu to scroll when content too tall, add new menu open/close animation, keep logo and close button above sliding panel, make menu pass below the top bar (had to add header bg layer), match nav colour to bg colour when menu open
@gellowg
gellowg marked this pull request as ready for review September 12, 2026 19:53
@cssbhamdev
cssbhamdev enabled auto-merge (squash) September 12, 2026 19:54
@gellowg gellowg changed the title Reorganise main navigation menu Rework main navigation menu Sep 12, 2026
automatic-pr-updater Bot and others added 7 commits September 12, 2026 20:45
This reverts commit 5441b63.
Page defaults to assuming JS is not available. When navigation JS loads it adds a JS class to <html>.

Without that class, desktop dropdown is opened on hover or keyboard focus.
@gellowg
gellowg force-pushed the reorganise-main-menu branch from 394fd49 to 8e1d4b2 Compare September 13, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sync Keep this pr up to date with it's base branch automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant