Skip to content

Commit 9a2e24b

Browse files
committed
darkmode tweaks
1 parent a38c0b4 commit 9a2e24b

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

docs/output-formats/autodark.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
img.autodark {
2+
filter: invert(100%) hue-rotate(180deg);
3+
}

docs/output-formats/html-accessibility.qmd

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
title: "HTML Accessibility Checks"
3+
css:
4+
- autodark.css
35
---
46

57
::: callout-note
@@ -22,9 +24,9 @@ In this situation, if your webpage has accessibility violations that `axe-core`
2224

2325
### Customization
2426

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.
2628

27-
- `output: document`: embedded reports
29+
- `document`: embedded reports
2830

2931
``` yaml
3032
format:
@@ -37,7 +39,7 @@ Quarto supports two additional output formats for the accessibility checks, avai
3739

3840
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.
3941

40-
- `output: json`: JSON-formatted console output
42+
- `json`: JSON-formatted console output
4143

4244
``` yaml
4345
format:
@@ -50,7 +52,7 @@ Quarto supports two additional output formats for the accessibility checks, avai
5052

5153
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).
5254

53-
- `output: console`
55+
- `console`
5456

5557
``` yaml
5658
format:
@@ -65,6 +67,8 @@ Quarto supports two additional output formats for the accessibility checks, avai
6567

6668
As a minimal example of how this works in Quarto, consider this simple document:
6769

70+
::: light-content
71+
6872
``` qmd
6973
---
7074
title: Testing Quarto's accessibility checker
@@ -77,9 +81,34 @@ format:
7781
This violates contrast rules: [insufficient contrast.]{style="color: #eee"}.
7882
```
7983

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+
80103
This is the produced result visible on the page:
81104

105+
::: {.light-content}
82106
![The rendered webpage with an accessibility violation warning](images/axe-violation.png)
107+
:::
108+
109+
::: {.dark-content}
110+
![The rendered webpage with an accessibility violation warning](images/axe-violation.png){.autodark}
111+
:::
83112

84113
## Planned work: automated checks before publishing
85114

0 commit comments

Comments
 (0)