Revealjs line highlighting cannot meet WCAG contrast
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- css, javascript
調査の方向性
Start with src/resources/formats/revealjs/plugins/line-highlight/line-highlight.css and reproduce the contrast measurements using the provided Quarto revealjs example. Review the Line Highlighting section of the revealjs documentation, then determine whether the completed change should document the limitation, provide an accessible emphasis method, or both; done means the documentation and any chosen presentation behavior address the stated WCAG concerns.
索引モデルが issue の本文から書いたものです。
説明
In revealjs, code-line-numbers highlights lines by fading the other lines to opacity: 0.4 (line-highlight.css#L1-L7). The design comes from the reveal.js highlight plugin, which uses the same value.
At 0.4, the faded lines fail WCAG 1.4.3 Contrast (Minimum). With the default highlight theme on a white background, faded tokens are 1.7:1 to 2.6:1. The requirement is 4.5:1.
No other opacity value is a good fix. The token colors of the theme are close to 4.5:1 at full opacity, so they have almost no room to fade:
| Token | Color | Contrast at 1.0 | Contrast at 0.4 | Minimum opacity for 4.5:1 |
|---|---|---|---|---|
attribute (.at) |
#657422 | 5.15 | 1.74 | 0.94 |
import (.im) |
#00769e | 5.14 | 1.81 | 0.93 |
comment (.co) |
#5e5e5e | 6.48 | 1.85 | 0.85 |
| plain text | #111111 | 18.88 | 2.62 | 0.58 |
At 0.94, the highlighted line looks the same as the other lines. The feature then has no function.
The faded text is not exempt. WCAG gives an exemption only for "incidental" text, and the faded lines are content that the audience reads for context. Sometimes an earlier step shows all the lines at full opacity (code-line-numbers="|2|4-5"). This does not help a person in the audience, because that person cannot go back to the earlier step.
Suggestions
- Documentation: In the Line Highlighting section, tell authors that the fade does not meet WCAG contrast. Tell authors who need accessible slides not to use
code-line-numbersfor this purpose. - Investigate other methods: Show emphasis on the highlighted lines and keep the other lines at full contrast. Some possible methods are a background color, a left border, or a bold font weight. A method that uses only color must also meet 1.4.11 Non-text Contrast and 1.4.1 Use of Color. This can be a new default or an option.
Repro
---
format: revealjs
---
## Python
```{.python code-line-numbers="2|4-5"}
import numpy as np # a comment
x = np.linspace(0, 10, 100)
def f(x, k=2):
"""Docstring here."""
return x ** k + 3.5
```
Quarto 1.11.4, default revealjs theme. The contrast values come from the computed styles in Chrome.
AI tools helped with this investigation. The investigation used a local clone of quarto-cli (see "Using AI tools to investigate" in CONTRIBUTING.md).
- 主要言語
- JavaScript
- スター
- 6.1k
- フォーク
- 463
- 平均マージ
- 21時間 14分
- マージ済み PR(30日)
- 60
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
bug callouts regression revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quarto-dev/quarto-cli#15014 ·
メンテナーはふだん 1 日以内に返信
-
Website navbar hides the notebook preview header対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンaccessibility bug embed websites
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/quarto-cli#14972 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
accessibility documentation revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
quarto-dev/quarto-cli#14971 ·
メンテナーはふだん 1 日以内に返信
-
accessibility revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
quarto-dev/quarto-cli#14970 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
a11y: notebook preview header is outside any landmark対応中かも @cderv が 2 日前に担当しました。 オープンaccessibility embed
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
quarto-dev/quarto-cli#14968 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
XRPLF/xrpl-dev-portal#4000 ·
メンテナーはふだん 1 日以内に返信
-
accessibility good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Bubble chart series name is not XML-escaped in the embedded workbook (xl/tables/table1.xml)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
-
Content:Learn needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
anoopcodehack/DevBoard#609 ·
メンテナーはふだん 1 日以内に返信