Skip to content

fix(theme): make all text readable on dark surfaces#96

Merged
krazyjakee merged 1 commit into
masterfrom
fix/theme-text-colors
Jun 9, 2026
Merged

fix(theme): make all text readable on dark surfaces#96
krazyjakee merged 1 commit into
masterfrom
fix/theme-text-colors

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

What

Rewrites _textTheme in lib/theme/app_theme.dart so every TextTheme slot is defined with an explicit color.

Why

buildAppTheme applies the custom text styles via base.copyWith(textTheme: _textTheme(palette)). ThemeData.copyWith replaces the text theme wholesale — it does not merge with the base typography (confirmed in the Flutter SDK: copyWith does textTheme ?? this.textTheme, whereas the merge only happens in the main ThemeData(...) constructor).

As a result, any text style that _textTheme left:

  • undefinedheadlineSmall, headlineMedium, bodySmall, labelSmall, or
  • defined without a colordisplayLarge / displayMedium / displaySmall, headlineLarge

…fell through to the framework's near-black default and was effectively invisible on the app's dark surfaces. The most visible victim was the "Daccord" welcome title, which uses headlineSmall.

Change

  • All 15 text styles are now defined with an explicit color: high-emphasis (dirtyWhite) for headings/body, muted (gray) for labels.
  • Metrics are kept tight (no inherited height) to match the original layout — an earlier attempt that seeded from the platform TextTheme via .apply() pulled in Material's taller default line-heights and caused the welcome feature cards to overflow ("BOTTOM OVERFLOWED BY 16 PIXELS"). This version avoids that.

Notes for reviewer

  • Scope is intentionally limited to lib/theme/app_theme.dart. Regenerated *.g.dart files and a downgraded pubspec.lock in the working tree were not included — they were byproducts of building under the stable Flutter SDK (the repo pins beta via .fvmrc, whose Dart VM requires macOS 14 and can't run on the dev machine here).
  • Visual verification on the Chrome (-d chrome) build is still recommended: confirm the "Daccord" title is light/readable and the welcome feature cards show no overflow stripes.

🤖 Generated with Claude Code

ThemeData.copyWith replaces the text theme wholesale rather than merging
with the base typography, so any slot _textTheme left undefined
(headlineSmall, headlineMedium, bodySmall, labelSmall) or defined without
a color (displayLarge/Medium/Small, headlineLarge) fell back to the
framework's near-black default and was unreadable on the dark surfaces —
most visibly the "Daccord" welcome title (headlineSmall).

Define all 15 text styles with explicit high-emphasis or muted colors,
keeping the original tight metrics (no inherited line-height) so layouts
like the welcome feature cards don't overflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@krazyjakee krazyjakee merged commit b4bc217 into master Jun 9, 2026
1 check passed
@krazyjakee krazyjakee deleted the fix/theme-text-colors branch June 9, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant