You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/output-formats/html-accessibility.qmd
+33-4Lines changed: 33 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
---
2
2
title: "HTML Accessibility Checks"
3
+
css:
4
+
- autodark.css
3
5
---
4
6
5
7
::: callout-note
@@ -22,9 +24,9 @@ In this situation, if your webpage has accessibility violations that `axe-core`
22
24
23
25
### Customization
24
26
25
-
Quarto supports two additional output formats for the accessibility checks, available through `output` option.
27
+
Quarto supports two additional output formats for the accessibility checks, available through the `output` option.
26
28
27
-
- `output: document`: embedded reports
29
+
- `document`: embedded reports
28
30
29
31
``` yaml
30
32
format:
@@ -37,7 +39,7 @@ Quarto supports two additional output formats for the accessibility checks, avai
37
39
38
40
If you wish to use this feature, we recommend adding it to a "debug" [project profile](/docs/projects/profiles.qmd) to reduce the chance you will accidentally publish a website to production with these reports.
39
41
40
-
- `output: json`: JSON-formatted console output
42
+
- `json`: JSON-formatted console output
41
43
42
44
``` yaml
43
45
format:
@@ -50,7 +52,7 @@ Quarto supports two additional output formats for the accessibility checks, avai
50
52
51
53
Specifically, the JSON object produced is the result of running `axe-core`'s `run` method on the webpage. We defer to `axe-core`'s [documentation for full information on that object](https://github.com/dequelabs/axe-core).
52
54
53
-
- `output: console`
55
+
- `console`
54
56
55
57
``` yaml
56
58
format:
@@ -65,6 +67,8 @@ Quarto supports two additional output formats for the accessibility checks, avai
65
67
66
68
As a minimal example of how this works in Quarto, consider this simple document:
67
69
70
+
::: light-content
71
+
68
72
``` qmd
69
73
---
70
74
title: Testing Quarto's accessibility checker
@@ -77,9 +81,34 @@ format:
77
81
This violates contrast rules: [insufficient contrast.]{style="color: #eee"}.
78
82
```
79
83
84
+
:::
85
+
86
+
::: dark-content
87
+
88
+
``` qmd
89
+
---
90
+
title: Testing Quarto's accessibility checker
91
+
format:
92
+
html:
93
+
axe:
94
+
output: document
95
+
---
96
+
97
+
This violates contrast rules: [insufficient contrast.]{style="color: #111"}.
98
+
```
99
+
100
+
:::
101
+
102
+
80
103
This is the produced result visible on the page:
81
104
105
+
::: {.light-content}
82
106

107
+
:::
108
+
109
+
::: {.dark-content}
110
+
{.autodark}
111
+
:::
83
112
84
113
## Planned work: automated checks before publishing
0 commit comments