Skip to content

feat(website): Phosphor icon system + mobile nav fix #844

Description

@ashleyshaw

Summary

Replace all emoji icons across the Awesome GitHub Astro site with inline Phosphor SVGs, and fix the mobile navigation menu's z-index stacking and scroll-lock behaviour.

Changes

Phosphor icon system

  • New Icon.astro component — resolves Phosphor SVG assets at build time via import.meta.resolve() + fs.readFileSync, inlines them with set:html, and regex-replaces existing width/height attributes to avoid duplicate attributes
  • console.warn on missing icon name so typos surface at build time
  • TRACK_ICONS constant extracted to lib/learn.ts (was duplicated across two learn pages)
  • Emoji replaced with <Icon> on: getting-started.astro, c/[type]/index.astro, cookbook/[slug].astro, learning-hub/index.astro, learn/index.astro, learn/[track]/index.astro
  • resources.ts icon values updated from emoji to Phosphor icon names
  • .ag-type-icon CSS updated from font-size: 32px to display: flex; color: var(--accent) (SVG does not respond to font-size)
  • @phosphor-icons/core added to website/package.json

Mobile navigation fix

  • .ag-nav-menu assigned z-index: 99 in @media (max-width: 768px) (was z-index: auto, stacking behind page content)
  • Body scroll-lock: document.body.style.overflow = "hidden" on open, cleared on close
  • matchMedia resize handler clears scroll-lock if viewport widens past 768 px while menu is open
  • closeMenu helper scoped inside if (hamburger && menu) guard for TypeScript correctness
  • Escape key closes menu and restores focus to hamburger button

Implemented in

PR #843

Metadata

Metadata

Assignees

Type

No type

Priority

None yet

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions