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

aria-deprecated-role

它能做什么

这项技能找出过时的或不应在 HTML 中使用的 ARIA 角色。适合希望标记代码能在各种浏览器和辅助工具中良好运行的开发者。

适用场景

  • ✓当你在代码中发现 directory 这样的角色时。
  • ✓当你要把旧的标记更新到当前的无障碍标准时。
  • ✓当原生 HTML 元素可以替代自定义角色时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-deprecated-role/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请在我的模板中搜索旧的 ARIA 角色,并告诉我应该改用什么。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会在标记中搜索已弃用或抽象的角色,并将其替换为当前的角色,或更简单的原生 HTML 元素。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Avoid using deprecated ARIA roles

Using deprecated roles can lead to inconsistent behavior across different browsers and screen readers as they transition to newer standards.

Quick Reference

  • Deprecated ARIA roles should be replaced with modern equivalents
  • Browsers may drop support for deprecated roles in future versions
  • Ensures long-term compatibility with assistive technologies

Check

Search the codebase for deprecated ARIA roles like directory or abstract roles that shouldn't be used in HTML.

Fix

Update deprecated ARIA roles to their modern recommended equivalents or use native HTML elements.

Explain

Explain the risks of using deprecated ARIA roles and the benefits of moving to modern ARIA standards.

Code Review

Review the rendered markup and interactive states that affect Avoid using deprecated ARIA roles. 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/aria-deprecated-role

常见问题

为什么已弃用的角色是个问题?

这项技能说明,浏览器和屏幕阅读器对它们的处理可能不一致,之后也可能不再支持。

什么是抽象角色?

这项技能指出,抽象角色仅用于规范说明,不应出现在 HTML 中。

有比 ARIA 更简单的选择吗?

有。这项技能建议,只要原生 HTML 元素能完成同样的工作,就优先使用它。

详情

作者的原始描述

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid using deprecated ARIA roles. 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
排名
#2725
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能