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

[#51] Header and footer #54

Open
wants to merge 10 commits into
base: jp/45-page-blocks-and-sections
Choose a base branch
from

Conversation

joshuapease
Copy link
Contributor

@joshuapease joshuapease commented Oct 7, 2024

Overview

This PR adds an accessible header, navigation and footer to the site starter.

Header & Navigation:

Front End

  • There is separate markup for the desktop and header nav.
  • However, they both share the same Alpine component for toggling navigation.

Accessibility / Focus Management

  • Desktop
    • When opening a nav item, the first child link is focused.
    • Pressing ESC will close the current level of the nav and return focus to the toggle that opened that level of nav.
    • Tabbing out of the current level of nav will close it.
CleanShot.2024-10-07.at.15.23.56.mp4
  • Mobile
    • The mobile nav toggle uses the patterns outlined here.
    • Alpine's focus trap / inert / noscroll keeps the mobile nav links locked into place.
    • Child nav items are toggled within the page (similar to how we're doing it on BEF).

Note

Intentionally using duplicate nav items so that the overlay will scroll.

CleanShot.2024-10-07.at.16.35.51-converted.mp4

Craft Admin

CleanShot 2024-10-07 at 14 19 23@2x

Footer

The footer is pretty basic, it includes a logo, links, and some placeholder copyright / privacy policy.

CleanShot 2024-10-07 at 14 11 04@2x CleanShot 2024-10-07 at 14 20 15@2x CleanShot 2024-10-07 at 14 20 23@2x

Craft Admin

The maximum depth is two. It uses the default field condig for Verbb navigation nodes.

CleanShot 2024-10-07 at 14 16 38@2x CleanShot 2024-10-07 at 14 18 04@2x CleanShot 2024-10-07 at 14 18 26@2x

The nav has a max depth of 3 levels. This simplifies our markup since it doesn't have to be recursive
The desktop and mobile nav markup will be their own partials.
Instead of using a focus trap, we focus on the first element in the
sub nav, but allow you to tab out of the list. When focus
leaves, we pop the subnav.
@joshuapease joshuapease changed the title Jp/51 header and footer [#51] Header and footer Oct 7, 2024
@joshuapease joshuapease force-pushed the jp/51-header-and-footer branch from 02e2624 to 528e251 Compare October 7, 2024 23:48
@joshuapease joshuapease marked this pull request as ready for review October 8, 2024 15:17
Comment on lines +23 to +36
smd: { max: '639.98px' },
sm: '640px',

mdd: { max: '749.98px' },
md: '768px',

lgd: { max: '1023.98px' },
lg: '1024px',

xld: { max: '1279.98px' },
xl: '1280px',

'2xld': { max: '1535.98px' },
'2xl': '1536px',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the default tailwind sizes, but also have a "down" variant that lets you select screens that are below a certain breakpoint's size.

Really helps when styles deviate a lot on mobile.

@joshuapease joshuapease force-pushed the jp/51-header-and-footer branch from 528e251 to d526e75 Compare October 8, 2024 15:25
Copy link

@ten1seven ten1seven left a comment

Choose a reason for hiding this comment

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

👍

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.

3 participants