nielsdeblaauw/twigcs-a11y
Composer 安装命令:
composer require nielsdeblaauw/twigcs-a11y
包简介
Accessibility rules for TwigCS
README 文档
README
This is a TwigCS accessibility ruleset. It statically checks twig templates for known accessibility issues.
The ruleset is inspired by Deque's Axe Linter
Note: Automated tests do not guarantee your site is accessible. Manual testing is the only way to make sure.
Want to learn more about creating accessible websites? Check out The A11Y Collective.
Installation
composer require --dev nielsdeblaauw/twigcs-a11y
Use
vendor/bin/twigcs --ruleset \\NdB\\TwigCSA11Y\\Ruleset
Example Output
./tests/test.twig
l.2 c.0 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=1>.`
l.12 c.20 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=test.`
l.12 c.53 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex='test'.`
l.16 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'marquee' is dissallowed. Found `<marquee>`.
l.18 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'blink' is dissallowed. Found `<blink>`.
5 violation(s) found
For additional options read the TwigCS documentation.
Rules
The following rules are implemented as part of this ruleset.
TabIndex
Axe Tabindex rule description.
Using a non 0 or -1 value for tabindex results in unexpected behaviour for keyboard users. Variables in the tabindex property of an element are considered invalid.
BannedHTMLTags
The blink and marquee tags are disallowed from use. These elements can cause issues for users with cognitive disabilities.
AriaRoles
Axe aria-roles rule description.
Catches invalid Aria role values. Typo's, non-standard and dynamic roles are not allowed.
Invalid roles can not be correctly interpreted by assistive technology.
Roadmap
The idea is to implement as many rules as possible from the Axe Linter ruleset.
nielsdeblaauw/twigcs-a11y 适用场景与选型建议
nielsdeblaauw/twigcs-a11y 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 85.72k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2020 年 10 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nielsdeblaauw/twigcs-a11y 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nielsdeblaauw/twigcs-a11y 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 85.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-08