Skip to content

Add support and styling for custom <callout-box> HTML tags#4264

Merged
szakarias merged 3 commits into
dart-lang:mainfrom
szakarias:blue-box
Jul 3, 2026
Merged

Add support and styling for custom <callout-box> HTML tags#4264
szakarias merged 3 commits into
dart-lang:mainfrom
szakarias:blue-box

Conversation

@szakarias

@szakarias szakarias commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
image

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

Copy link
Copy Markdown

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 introduces built-in CSS styling and support for a custom <example> HTML tag to display highlighted code examples. The reviewer feedback recommends renaming the custom element to include a hyphen (e.g., <dartdoc-example>) to comply with the HTML specification. Additionally, the reviewer suggests centralizing theme variables by using a CSS custom property --example-bg-color and advises regenerating the lib/resources/styles.css file using the project's task runner instead of editing it manually.

Comment thread lib/src/render/documentation_renderer.dart Outdated
Comment thread web/styles/_theme.scss Outdated
Comment thread web/styles/_theme.scss Outdated
Comment thread web/styles/_content.scss Outdated
Comment thread lib/resources/styles.css Outdated
Comment thread web/styles/_content.scss
@szakarias szakarias changed the title Add support and styling for custom <example> HTML tags Add support and styling for custom <callout-box> HTML tags Jul 2, 2026

@sigurdm sigurdm 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.

Would be cool with a screenshot in the PR description.

@szakarias

Copy link
Copy Markdown
Contributor Author

Fixes #4243

@szakarias
szakarias merged commit 9831db9 into dart-lang:main Jul 3, 2026
19 checks passed
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 9, 2026
…12120)

## Background

[Dartdoc 9.0.7](dart-lang/dartdoc#4264) added support for `<callout-box>` (what we used to call the _blue container_).

## What's changed

This PR migrates all should-be Dartpad instances in API docs to `<callout-box>`. This is what it looks like:

<img width="722" height="640" alt="image" src="https://github.com/user-attachments/assets/c508c8b1-9b97-4500-9aea-cf2bce81df0a" />

This PR also disables `unintended_html_in_doc_comment` because `<callout-box>` is not recognized by the linter for now. An issue has been filed: dart-lang/sdk#63782

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 11, 2026
…12146)

## Background

[Dartdoc 9.0.7](dart-lang/dartdoc#4264) added support for `<callout-box>` (what we used to call the _blue container_).

## What's changed

This PR migrates all former snippet instances in API docs to `<callout-box>`. This is what it looks like:

<img width="734" height="302" alt="image" src="https://github.com/user-attachments/assets/cd0bd77c-4ab2-4875-8fbe-e838e0902c16" />

This PR also disables `unintended_html_in_doc_comment` because `<callout-box>` is not recognized by the linter for now. An issue has been filed: dart-lang/sdk#63782

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
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.

3 participants