From 6b70e790cc8b31d62201114e93491032e810bebf Mon Sep 17 00:00:00 2001 From: pkdee Date: Sun, 5 Jul 2026 02:28:06 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20seed=20=EC=B5=9C=EC=8B=A0=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EB=B0=98=EC=98=81=20+=20DkBadge=20solid=20?= =?UTF-8?q?=EB=B3=80=ED=98=95=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - flutter pub upgrade seed_design(861b9b) — fgSubtle 72% 대비 보정·hue subtle 통일 - 본문·보조 텍스트 대비 테스트 추가(seed 게이트 미러, 업그레이드 전 RED 검증) - DkBadge.solid 제거 — 미사용 + 다크 앰버 배경 흰 글자 대비 미달 경로 Closes #208 --- lib/widgets/dk_badge.dart | 9 ++++----- pubspec.lock | 2 +- test/theme_contrast_test.dart | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/lib/widgets/dk_badge.dart b/lib/widgets/dk_badge.dart index 23ef0e9..79e8c6e 100644 --- a/lib/widgets/dk_badge.dart +++ b/lib/widgets/dk_badge.dart @@ -13,27 +13,26 @@ enum DkTone { neutral, primary, success, warning, danger, info, violet } } /// 디자인 시스템 뱃지. 프로토타입 `Badge`: padding 3×9, radius 8, 12/600. -/// [solid]이면 fg 배경 + 흰 글자. +/// 톤은 항상 subtle 배경 + Fg 텍스트(대비 게이트 보장 조합). 과거 solid 변형(톤색 +/// 배경 + 흰 글자)은 다크 앰버 위 대비 미달 경로라 제거했다(2026-07-05 감사). class DkBadge extends StatelessWidget { const DkBadge( this.label, { super.key, this.tone = DkTone.neutral, this.leading, - this.solid = false, }); final String label; final DkTone tone; final Widget? leading; - final bool solid; @override Widget build(BuildContext context) { final DkTokens t = DkTheme.of(context); final colors = dkToneColors(t, tone); - final Color bg = solid ? colors.fg : colors.bg; - final Color fg = solid ? t.onPrimary : colors.fg; + final Color bg = colors.bg; + final Color fg = colors.fg; return Container( padding: const EdgeInsets.symmetric( diff --git a/pubspec.lock b/pubspec.lock index 479efa9..7c6aec7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -709,7 +709,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "1910eca50b7a64b1ebbf80c10fcc3eb30487f864" + resolved-ref: "861b9bd00fc0e35f7d01901ce97a12fb028b55f3" url: "https://github.com/ieoseo/seed-design.git" source: git version: "0.1.0" diff --git a/test/theme_contrast_test.dart b/test/theme_contrast_test.dart index 0d0f115..fd22b62 100644 --- a/test/theme_contrast_test.dart +++ b/test/theme_contrast_test.dart @@ -85,6 +85,32 @@ void main() { expect(t.byKey('onPrimary'), t.onPrimary); expect(_contrast(t.onPrimary, t.primary), greaterThanOrEqualTo(4.5)); }); + + test('본문·보조 텍스트는 표면 4종 위 4.5:1 이상(seed 게이트 미러)', () { + final Map fgs = { + 'fg': t.fg, + 'fgMuted': t.fgMuted, + 'fgSubtle': t.fgSubtle, + }; + final Map bgs = { + 'bg': t.bg, + 'bgSubtle': t.bgSubtle, + 'bgPress': t.bgPress, + 'page': t.page, + }; + for (final MapEntry f in fgs.entries) { + for (final MapEntry b in bgs.entries) { + final Color fg = _composite(f.value, b.value); + final double ratio = _contrast(fg, b.value); + expect( + ratio, + greaterThanOrEqualTo(4.5), + reason: + '$label ${f.key} on ${b.key} = ${ratio.toStringAsFixed(2)}:1', + ); + } + } + }); }); }