Skip to content
代码片段 群组 项目
未验证 提交 9139565b 编辑于 作者: Paulina Sedlak-Jakubowska's avatar Paulina Sedlak-Jakubowska 提交者: GitLab
浏览文件

Add axe linter as recommended extension for VS Code

Adds custom mapping for Pajamas components and documentation
about using the linter.
上级 0e609dae
No related branches found
No related tags found
无相关合并请求
{ {
"recommendations": [ "recommendations": [
"gitlab.gitlab-workflow", "gitlab.gitlab-workflow",
"shopify.ruby-lsp" "shopify.ruby-lsp",
"deque-systems.vscode-axe-linter"
] ]
} }
global-components:
gl-button:
element: button
attributes:
- aria-*
gl-avatar:
element: img
gl-avatar-link:
element: a
gl-avatar-labeled:
element: img
attributes:
- label: alt
gl-toggle:
element: button
attributes:
- label: aria-labelledby
- description: aria-describedby
gl-link:
element: a
...@@ -9,15 +9,19 @@ info: Any user with at least the Maintainer role can merge updates to this conte ...@@ -9,15 +9,19 @@ info: Any user with at least the Maintainer role can merge updates to this conte
Accessibility is important for users who use screen readers or rely on keyboard-only functionality Accessibility is important for users who use screen readers or rely on keyboard-only functionality
to ensure they have an equivalent experience to sighted mouse users. to ensure they have an equivalent experience to sighted mouse users.
## Accessibility best practices ## Linting for accessibility defects
Follow these [best practices](best_practices.md) to implement accessible web applications. These are You can enable linting for accessibility defects with a free VS Code plugin - [axe Accessibility Linter](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter).
some of the topics covered in that guide: We strongly recommend that to everyone contributing to GitLab that use VS Code.
- [Quick checklist](best_practices.md#quick-checklist) 1. Open VS Code editor
- [Accessible names for screen readers](best_practices.md#provide-accessible-names-for-screen-readers) 1. Go to Extensions
- [Icons](best_practices.md#icons) 1. Search for axe Accessibility Linter and install the plugin
- [When to use ARIA](best_practices.md#when-to-use-aria)
Axe Accessibility Linter works in HTML, Markdown and Vue files. As for this moment, there is no support for HAML files. You will get immediate feedback, while writing your code.
GitLab repository contains `axe-linter.yml` file that adds additional configuration to the plugin.
It enables the linter to analyze some of the Pajamas components by mapping them and their attributes to native HTML elements.
## Automated accessibility testing ## Automated accessibility testing
...@@ -27,6 +31,16 @@ Uncover accessibility problems and ensure that your features stay accessible ove ...@@ -27,6 +31,16 @@ Uncover accessibility problems and ensure that your features stay accessible ove
- [When to add accessibility tests](automated_testing.md#when-to-add-accessibility-tests) - [When to add accessibility tests](automated_testing.md#when-to-add-accessibility-tests)
- [How to add accessibility tests](automated_testing.md#how-to-add-accessibility-tests) - [How to add accessibility tests](automated_testing.md#how-to-add-accessibility-tests)
## Accessibility best practices
Follow these [best practices](best_practices.md) to implement accessible web applications. These are
some of the topics covered in that guide:
- [Quick checklist](best_practices.md#quick-checklist)
- [Accessible names for screen readers](best_practices.md#provide-accessible-names-for-screen-readers)
- [Icons](best_practices.md#icons)
- [When to use ARIA](best_practices.md#when-to-use-aria)
## Other resources ## Other resources
Use these tools and learning resources to improve your web accessibility workflow and skills. Use these tools and learning resources to improve your web accessibility workflow and skills.
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册