Skip to content

Fix unreadable release notes blockquote in dark theme - #9957

Merged
srawlins merged 2 commits into
flutter:masterfrom
Yusufihsangorgel:issue-9945-blockquote-contrast-v5
Aug 12, 2026
Merged

Fix unreadable release notes blockquote in dark theme#9957
srawlins merged 2 commits into
flutter:masterfrom
Yusufihsangorgel:issue-9945-blockquote-contrast-v5

Conversation

@Yusufihsangorgel

Copy link
Copy Markdown
Contributor

Work towards #9945

The blockquote fill comes from MarkdownStyleSheet.fromTheme, which hard codes it to Colors.blue.shade100 and takes the text style from the theme. With the dark palette, that works out to #C7C6CA on #BBDEFB, a 1.21:1 ratio. The 2.60.0 notes open with a blockquote right under the title, which is the banner in the screenshots.

I moved the decoration onto the panel: the fill becomes secondaryContainer and the corner radius follows defaultBorderRadius instead of the hard coded 2.0. I kept the text color at onSurface, which clears AA on the new fill, 5.48:1 dark and 13.29:1 light, and keeps the diff to just the one stylesheet override. Widget tests measure the contrast in both themes.

The rest of the issue, whether the notes belong in the embedded view, is untouched.

Before After
Dark The release notes blockquote before the fix, dark theme The release notes blockquote after the fix, dark theme
Light The release notes blockquote before the fix, light theme The release notes blockquote after the fix, light theme

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

build.yaml badge

If you need help, consider asking for help on Discord.

MarkdownStyleSheet.fromTheme takes the blockquote text style from the
theme but hard codes the fill as Colors.blue.shade100, so the side panel
drew onSurface text on light blue. Release notes that open with a
blockquote, like 2.60.0, were unreadable in the dark theme.

The panel now passes its own blockquote decoration, and widget tests
assert the text clears WCAG AA contrast in both themes.
@Yusufihsangorgel
Yusufihsangorgel requested a review from a team as a code owner August 12, 2026 11:46
@Yusufihsangorgel
Yusufihsangorgel requested review from srawlins and removed request for a team August 12, 2026 11:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue with unreadable blockquote text in the release notes panel under the dark theme by customizing the blockquote decoration in the SidePanel. It also introduces a regression test to ensure proper contrast ratios across both light and dark themes. The reviewer identified a critical issue where instantiating MarkdownStyleSheet directly discards other theme-derived styles, and suggested using MarkdownStyleSheet.fromTheme(theme).copyWith(...) to preserve the stylesheet.

Comment on lines +185 to +195
styleSheet: MarkdownStyleSheet(
// [MarkdownStyleSheet.fromTheme], which supplies the
// rest of the style sheet, hard codes
// `Colors.blue.shade100` as the blockquote fill while
// taking the text color from the theme. In the dark
// theme that draws light gray text on light blue.
blockquoteDecoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: defaultBorderRadius,
),
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

[MUST-FIX] Instantiating MarkdownStyleSheet directly via its default constructor will result in a stylesheet where all other text styles (such as p, h1, code, etc.) are null. This causes the Markdown widget to fall back to default unstyled text, losing all theme-derived styles (fonts, sizes, colors) for the rest of the release notes.

To preserve the theme's styles while overriding only the blockquote decoration, use MarkdownStyleSheet.fromTheme(theme).copyWith(...) instead.

Suggested change
styleSheet: MarkdownStyleSheet(
// [MarkdownStyleSheet.fromTheme], which supplies the
// rest of the style sheet, hard codes
// `Colors.blue.shade100` as the blockquote fill while
// taking the text color from the theme. In the dark
// theme that draws light gray text on light blue.
blockquoteDecoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: defaultBorderRadius,
),
),
styleSheet: MarkdownStyleSheet.fromTheme(theme).copyWith(
// MarkdownStyleSheet.fromTheme, which supplies the
// rest of the style sheet, hard codes
// Colors.blue.shade100 as the blockquote fill while
// taking the text color from the theme. In the dark
// theme that draws light gray text on light blue.
blockquoteDecoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: defaultBorderRadius,
),
)
References
  1. The repository style guide requires prefixing comments with a severity category, such as [MUST-FIX] for logical bugs. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The widget merges this sheet over the theme one. flutter_markdown resolves kFallbackStyle(context, widget.styleSheetTheme).merge(widget.styleSheet) before parsing, widget.dart:391 in 0.7.7, and merge keeps every field the override leaves null. I probed this exact sheet on a dark theme, merged.p stays equal to MarkdownStyleSheet.fromTheme(theme).p while the blockquote fill changes. I'm keeping the minimal override.

@srawlins srawlins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!


/// The smallest contrast ratio WCAG 2.1 accepts for body text at level AA.
///
/// See https://www.w3.org/TR/WCAG21/#contrast-minimum.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs

@srawlins
srawlins merged commit 644500c into flutter:master Aug 12, 2026
92 of 94 checks passed
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.

2 participants