anchor-smooth-scroll
它能做什么
这项技能检查网站上同一页面内的链接如何滚动。适合希望跳转链接让对动态敏感的人感觉舒适的开发者。
适用场景
- ✓当你的网站对同一页面内的链接使用平滑滚动时。
- ✓当访客在设备设置中要求减少动态效果时。
- ✓当键盘用户使用跳转链接,而焦点没有到达目标位置时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/anchor-smooth-scroll/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请确保我的目录链接在用户偏好减少动态效果时能立即跳转。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查平滑滚动规则,把它限制在减少动态效果的设置之下,并确认焦点会移动到链接指向的部分。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Provide instant anchor scroll option
Smooth scroll animations can trigger vertigo, nausea, and disorientation for users with vestibular disorders—instant navigation is safer and often faster.
Quick Reference
- Disable smooth scroll when prefers-reduced-motion is set
- Use CSS scroll-behavior: smooth with media query check
- Ensure focus moves to anchor target for keyboard users
- Provide instant scroll as default or fallback
Check
Click anchor links (same-page navigation) and verify smooth scrolling is disabled when prefers-reduced-motion is set. Confirm anchor navigation works correctly with keyboard and screen readers.
Fix
Use scroll-behavior: smooth only within a prefers-reduced-motion media query check. Provide instant scrolling as the default or reduced-motion fallback. Ensure focus moves to the anchor target.
Explain
Explain how animated scroll transitions can cause motion sickness and disorientation for users with vestibular disorders, and why instant navigation is often preferable for accessibility.
Code Review
Review the rendered markup and interactive states that affect Provide instant anchor scroll option. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/anchor-smooth-scroll
常见问题
为什么平滑滚动可能带来问题?
这项技能说明,动画式滚动可能会使有前庭功能障碍的人感到眩晕或迷失方向。
什么是 prefers-reduced-motion?
它是一项设备设置,告诉网站访客希望减少动画效果。
焦点需要移动吗?
需要。这项技能说明,对键盘用户而言,焦点应移动到锚点目标。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Provide instant anchor scroll option. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2719
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。