Overlay contract: text contrast over the panel and a guard for new overlays (follow-up of #1158)

未关闭
#1,299 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
css, typescript

调研方向

Start by reading the alpha test and helpers (expectOpaqueSurface, colorAlpha, surfaceAlpha) that PR #1294 added to @codeatlasdev/ui/testing, then the overlay-token section of AGENTS.md and how Sheet paints --ca-surface-overlay. Extend that test file to render body text over a busy backdrop for each overlay and assert 4.5:1 against the composited panel color in light, dark, glass and frosted, add a guard test that fails when a role="dialog" | "menu" | "listbox" layer or FloatingLayer paints its fill from a non-overlay token, and record a decision on the --ca-sheet-* tokens.

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

描述

area:a11y area:tests enhancement

Follow-up of #1158 (PR #1294: expectOpaqueSurface, colorAlpha, surfaceAlpha in @codeatlasdev/ui/testing, and a test that every overlay panel stays at alpha ≥ 0.9 in both schemes on the default, glass and frosted styles; measured 1 for Dialog, AlertDialog, Drawer and Sheet, 0.94 for Popover and DropdownMenu under the blurred styles).

The consumer's evidence comment on #1158 asked for two more things that #1294 leaves out:

  1. Text contrast over the overlay, not only its alpha. The incident behind the contract was body text at 3.5:1 on a see-through panel. A test that renders text in each overlay over a busy backdrop (a high-contrast pattern behind the panel) and measures the text against the composited panel color, in dark and light, on the blurred styles: 4.5:1 for body text.
  2. A guard against a new overlay that skips the contract. Every floating panel paints its fill from the overlay tokens (--ca-overlay-bg, --ca-sheet-bg, --ca-surface-overlay); a lint or unit test that fails when a component with role="dialog" | "menu" | "listbox" (or a FloatingLayer) paints its background from anything else.

Also noticed: Sheet paints --ca-surface-overlay directly, so the --ca-sheet-* tokens AGENTS.md documents for Dialog, AlertDialog and Drawer do not reach it. Decide whether Sheet should read them too.

主要语言
TypeScript
星标
6
派生
3
平均合并
5 小时 21 分钟
30 天内合并 PR
378

环境准备

从这里开始

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

codeatlasdev/ui 的其他 Issue

查看 codeatlasdev/ui 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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