Code copy button icon ignores the button colour
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- css, html, scss
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu với src/resources/formats/html/_quarto-rules-copy-code.scss, được liên kết trong issue, rồi kiểm tra các quy tắc của biểu tượng sao chép và đã sao chép, bao gồm cả các biến thể khi di chuột. Báo cáo xác định phần tô màu SVG đã biên dịch là nguyên nhân và đề xuất dùng mặt nạ với currentColor. Hoàn thành khi cả hai biểu tượng đều theo màu CSS của nút trên mọi giao diện và trạng thái di chuột, kể cả trên khối mã tối.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
Quarto draws the copy button icon as a background-image SVG with its fill set at compile time from $btn-code-copy-color.
A background image can't read currentColor, so the icon keeps that compiled grey whatever colour the button gets in CSS.
This matters when a code block doesn't use the page's code background.
A dark "terminal" block on a light page is a common case.
Setting color on .code-copy-button is the natural fix, but the icon doesn't follow it.
On the dark block below, the icon is rgb(94, 94, 94) on rgb(17, 20, 24), which is 2.85:1 and under the 3:1 that WCAG 2.2 Success Criterion 1.4.11 asks for.
The same applies to the copied (check) icon and to the hover variants.
Steps to reproduce
---
title: "Copy button icon colour"
format:
html:
theme:
light: default
dark: darkly
include-in-header:
text: |
<style>
pre.dark-block,
div.sourceCode:has(> pre.dark-block) {
background-color: #111418;
color: #e6e8eb;
}
.code-copy-outer-scaffold:has(pre.dark-block) .code-copy-button {
color: #e6e8eb;
}
</style>
---
```{.bash .dark-block}
echo "hello"
```
Render it, hover the code block, and look at the copy button.
Actual behavior
The button computes color: rgb(230, 232, 235), but its .bi::before still paints the compiled icon:
background-image: url('data:image/svg+xml,<svg ... fill="rgb(94, 94, 94)" ...>');
The icon is grey on the dark block in both colour schemes.
Expected behavior
The icon follows the colour of the button, so a theme or a page can recolour it with color alone.
Drawing the icon as a mask-image over background-color: currentColor would do this, and $btn-code-copy-color could then set the button's color instead of the SVG fill.
Your environment
- IDE: none, the document is rendered with
quarto renderin a terminal. - OS: macOS 27.2 (Apple Silicon).
- Browser: Brave (Chromium).
- Quarto: a development build at 089ba530, which contains the v1.12.0 pre-release;
_quarto-rules-copy-code.scssis the same in v1.11.9, v1.12.0, and onmain.
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 089ba530b3ed4ec156a355d41b6b7de2db3e44ea
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking tools....................OK
TinyTeX: v2026.07
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
ℹ R version 4.6.1 (2026-06-24)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
Version: 4.6.1
Path: /Library/Frameworks/R.framework/Versions/4.6/Resources
LibPaths:
- /Users/mcanouil/Library/R/arm64/4.6/library
- /Library/Frameworks/R.framework/Versions/4.6/Resources/library
knitr: 1.51
rmarkdown: 2.31
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Library/Developer/CommandLineTools/usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking Julia installation...
- Ngôn ngữ chính
- JavaScript
- Star
- 6.1k
- Fork
- 478
- Merge trung bình
- 17 giờ 53 phút
- Pull request đã merge (30 ngày)
- 135
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
-
accessibility bug embed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
quarto-dev/quarto-cli#15306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bootstrap bug themes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quarto-dev/quarto-cli#15304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility brand bug dark-mode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quarto-dev/quarto-cli#15301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bootstrap bug html tables
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
quarto-dev/quarto-cli#15300 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug html
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto-cli#15297 ·
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ự
-
Build produces empty forge.min.js: package.json lists "forge" instead of "node-forge"Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Fei2411/DeepSeek-Bot#963 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Miaotofu01/Study-Mate#244 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test-reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-js#40672 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
txn2/mcp-data-platform#2492 ·
Maintainer thường phản hồi trong vòng 1 ngày