Repository navigation
Conversation
The label on a filled button was always textColorAnti (white), whatever the fill was. The theme generator ships light brands - its yellow preset is #f3b814 - and white on that is 1.8:1, well under the 4.5:1 WCAG minimum for normal text. Choose between the theme's dark and light label colours by the fill's relative luminance instead. The default brand #0052d9 is dark, so it keeps white and nothing changes for the default theme. Verified: - new test fails on the previous implementation (浅色主色上主按钮文字不用白色) - new test passes with the fix - button: 263 tests pass fix Tencent#1232
Contributor
Web DemoAPK 下载 |
The CI guard requires every *_test.dart under test/ to have an execution path in component_test_manifest.dart. The new file was not registered, so "all component and tooling test files have a CI execution path" failed. fix Tencent#1232
flutter analyze reports unnecessary_import because tdesign_flutter already re-exports everything the test uses, and the CI analyze job fails on it. fix Tencent#1232
6 of 16 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
fix #1232
📝 描述
填充按钮的文字颜色固定取
textColorAnti(白),不看填充色是什么:主题生成器提供浅色主色,它的黄色预设是
#f3b814,白字在上面只有 1.8:1,远低于 WCAG 正文要求的 4.5:1。改成按填充色的相对亮度在深/浅文字之间选。默认主色
#0052d9是深色,仍然用白字,默认主题下行为不变。#0052d9#4582e6#f3b814#d8a100danger预设同样处理。✅ 验证
无修复时测试失败:
有修复时测试通过:
回归:
📦 改动文件
tdesign-component/lib/src/components/button/t_button_resolve.dart(+13 -2)tdesign-component/test/components/button/t_button_brand_contrast_test.dart(+61)🚨 注意事项
TThemeBuilder里的onPrimary: t.textColorAnti是同一类问题(Material 侧),这个 PR 只改 TButton。需要的话可以另开一个。🔧 追加:CI 修复
第一次提交后 CI 的
Analyze和Tests / tooling挂了,两个都是真实问题:all component and tooling test files have a CI execution path失败 —— 仓库有个守卫要求test/下每个*_test.dart都必须在component_test_manifest.dart里注册。新加的测试文件漏注册了,已补上。flutter analyze报unnecessary_import—— 测试文件里package:flutter/material.dart是多余的,tdesign_flutter已经全部 re-export。已删掉。本地验证:
Build / Android的 Gradle 8.14.0 < 9.3.1 报错是仓库环境问题(Flutter latest 的 gradle plugin 要求),与本 PR 无关,#1245 里有同样的修复尝试。