Bootstrap's secondary and tertiary greys stay light in the dark colour scheme

未关闭 适合新手
#15,301 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
sass, scss
领域
accessibility

调研方向

从 src/resources/formats/html/bootstrap/dist/scss/_variables.scss 开始,查看 issue 指出的浅灰色默认值,并追踪深色 bundle 如何设置品牌颜色。根据深色背景推导次级和三级背景值,然后在深色模式下渲染提供的示例,并检查受影响的框是否具有清晰易读的对比度。

由索引模型根据 Issue 内容生成。

描述

accessibility brand bug dark-mode
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

In the dark colour scheme of a brand, Bootstrap's grey boxes keep the light greys of the light scheme, under the light text of the dark scheme.
The text then has a contrast of about 1:1 with its box, so it cannot be read (WCAG 1.4.3).

Bootstrap sets $body-secondary-bg: $gray-200 and $body-tertiary-bg: $gray-100 (src/resources/formats/html/bootstrap/dist/scss/_variables.scss, lines 450 and 453).
Quarto builds the dark bundle from the dark brand colours, but nothing moves these two variables away from the light greys.
They reach, among others:

  • the disabled form field ($input-disabled-bg),
  • the input group text box ($input-group-addon-bg),
  • the pagination hover, focus, and disabled boxes ($pagination-hover-bg, $pagination-focus-bg, $pagination-disabled-bg),
  • the popover header, the progress bar, and the active list group item.

Deriving $body-secondary-bg and $body-tertiary-bg from the dark background in the dark bundle would fix all of these at once.

Light Dark
Light scheme: the disabled field, the Filter box, and the Previous page box are light grey with dark text Dark scheme: the same three boxes stay light grey, and their light text is almost invisible
Steps to reproduce

_brand.yml:

color:
  background:
    light: "#ffffff"
    dark: "#14181c"
  foreground:
    light: "#1a1a1a"
    dark: "#e8e6e1"
  primary: "#1f6f8b"

index.qmd:

---
title: "Grey boxes in the dark scheme"
format: html
brand: _brand.yml
respect-user-color-scheme: true
---

```{=html}
<input class="form-control mb-2" value="Enabled field">
<input class="form-control mb-3" disabled value="Disabled field">
<div class="input-group mb-3">
  <span class="input-group-text">Filter</span>
  <input class="form-control" placeholder="Search">
</div>
<ul class="pagination">
  <li class="page-item disabled"><a class="page-link">Previous</a></li>
  <li class="page-item"><a class="page-link" href="#">1</a></li>
  <li class="page-item"><a class="page-link" href="#">2</a></li>
</ul>
```

Render it, and open it with the system set to dark mode.

Actual behavior
Scheme Element Background Text Contrast
Light Disabled field rgb(233, 236, 239) rgb(26, 26, 26) 14.68:1
Light Input group text rgb(248, 249, 250) rgb(26, 26, 26) 16.51:1
Light Disabled page rgb(233, 236, 239) rgba(26, 26, 26, 0.75) 6.97:1
Dark Disabled field rgb(233, 236, 239) rgb(232, 230, 225) 1.05:1
Dark Input group text rgb(248, 249, 250) rgb(232, 230, 225) 1.18:1
Dark Disabled page rgb(233, 236, 239) rgba(232, 230, 225, 0.75) 1.04:1

The pagination hover and focus boxes are light boxes on the dark page as well, with the link colour as text.

Expected behavior

In the dark scheme, these boxes sit on greys derived from the dark background, and their text keeps at least 4.5:1, as it does in the light scheme.

Your environment
  • OS: macOS 27.2.
  • Browser: Brave (Chromium).
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
[✓] 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
主要语言
JavaScript
星标
6.1k
派生
478
平均合并
17 小时 53 分钟
30 天内合并 PR
135

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/quarto-cli 的其他 Issue

查看 quarto-dev/quarto-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。