Revealjs line highlighting cannot meet WCAG contrast
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- css, javascript
- Lĩnh vực
- accessibility, documentation, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- JavaScript
- Star
- 6.1k
- Fork
- 466
- Merge trung bình
- 20 giờ 28 phút
- Pull request đã merge (30 ngày)
- 64
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto-cli
-
Revealjs: code block at the end of a callout lost its bottom spacing since 1.8.15Có thể đã có người làm @cderv đã nhận hôm nay. Đang mởbug callouts regression revealjs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
quarto-dev/quarto-cli#15014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility documentation revealjs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
quarto-dev/quarto-cli#14971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility revealjs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
quarto-dev/quarto-cli#14970 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility revealjs themes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto-cli#14963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility revealjs themes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
quarto-dev/quarto-cli#14962 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/quarto-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
[quality] Nothing keeps docs/skills/manifest.md in sync with docs/skills/*.mdCó thể đã có người làm @hivecommons-hive đã nhận hôm nay. Đang mởagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs verification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
apache/rocketmq-dashboard#6610 ·
Maintainer thường phản hồi trong vòng 3 ngày