跳到正文
Skillpedia
网站与界面(前端)75k · #2719

anchor-smooth-scroll

它能做什么

这项技能检查网站上同一页面内的链接如何滚动。适合希望跳转链接让对动态敏感的人感觉舒适的开发者。

适用场景

  • ✓当你的网站对同一页面内的链接使用平滑滚动时。
  • ✓当访客在设备设置中要求减少动态效果时。
  • ✓当键盘用户使用跳转链接,而焦点没有到达目标位置时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/anchor-smooth-scroll/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/anchor-smooth-scroll/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2719
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能