Digitalbank landing page with Vue, Vite, SCSS, and TypeScript

Solution retrospective
This is my first Vue project with TypeScript, and I built a fully keyboard-accessible mobile navigation from scratch — focus trap, focus restoration, aria-modal + aria-controls, and scoped inert — all without external libraries. I implemented mobile-first responsive SCSS with fluid typography (clamp()), aspect-ratio for CLS prevention, and a variable-based architecture (spacing, z-index, breakpoints). The component structure separates concerns cleanly: Header owns all nav state and a11y logic, Home owns content semantics, Footer manages external links securely.
The biggest challenge was realizing inert on <body> disabled the close button and overlay inside the header itself — I solved it by scoping inert to a dedicated #page-content wrapper (main + footer only) and managing state reactively through Vue's lifecycle hooks. I also hit TypeScript's strict null checks with document.querySelector and switched to template refs (ref<HTMLElement | null>(null) + onMounted). A module-level document.body.classList.toggle ran only once at load; moving it into a reactive updateInert() called from every state change fixed it. Finally, I implemented focus trap (Tab cycling, Escape handling) and focus restoration (nextTick + stored reference) so keyboard users never lose context.
- Accessibility — Focus trap implementation (Tab cycling, Escape),
aria-modal+aria-controlsusage,inertscoping correctness, skip link placement. - Vue/TypeScript patterns — Composables extraction (
useMediaQuery,useFocusTrap), lifecycle cleanup,nextTickfor DOM-ready focus, prop/emit typing. - SCSS architecture — Variable organization (spacing, z-index, breakpoints), mixin design, fluid typography with
clamp(), magic number elimination. - Responsive behavior — Mobile ↔ desktop transitions (nav visibility, inert toggling, hamburger show/hide), media query listener cleanup.
- Security & semantics — External links with
rel="noopener noreferrer",href="#"removal, social linkaria-labels, article image alt quality.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Yahyaball’s solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord