Skip to main content

build-a-responsive-navigation

Build responsive site navigation with semantic structure, reliable focus behavior, clear current state, and usable small-screen interaction. Use when one information architecture must work across pointer, keyboard, touch, zoom, and assistive technology.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
2
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
build-a-responsive-navigation
category
web
description
Build responsive site navigation with semantic structure, reliable focus behavior, clear current state, and usable small-screen interaction. Use when one information architecture must work across pointer, keyboard, touch, zoom, and assistive technology.
# build-a-responsive-navigation Keep the information architecture stable even when its presentation changes. ## When to use - Use for headers, primary menus, account navigation, nested sections, and mobile drawers. - Avoid separate desktop and mobile structures that expose different links or states. ## Procedure 1. Define destinations, hierarchy, labels, current-location rules, authentication variants, and the smallest supported viewport. 2. Use a navigation landmark, real links for destinations, and buttons only for disclosure or actions. 3. Implement desktop layout without hover-only access. Give expandable items explicit state and predictable keyboard behavior. 4. Transform the same logical items for small screens. If using a drawer or dialog, manage initial focus, background interaction, Escape, close controls, and focus return. 5. Preserve visible focus, logical DOM order, adequate targets, readable labels, and the current-page indicator. 6. Handle long translations, text zoom, safe areas, reduced motion, slow fonts, and content wrapping without clipping. 7. Prevent scroll locking, history, or route changes from leaving the menu or focus in a stale state. 8. Test anonymous and authenticated variants with keyboard, touch, screen reader, zoom, landscape, narrow screens, and JavaScript or network failure. ## Failure plan - If enhanced disclosure fails, keep core destinations reachable through progressive fallback. - If a breakpoint hides content from one modality, restore the shared semantic structure before polishing animation. ## Done - A navigation implementation preserves destinations, hierarchy, current state, and semantics at every supported size - Interaction tests verify pointer, touch, keyboard, focus, Escape, route changes, zoom, and assistive technology - A responsive evidence report records tested states, viewports, translations, failures, and fixes
在 GitHub 查看