Skip to content

docs(cdk/dialog): improve dialog example contrast in dark themes#33334

Open
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:fix-cdk-dialog-dark-theme-contrast
Open

docs(cdk/dialog): improve dialog example contrast in dark themes#33334
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:fix-cdk-dialog-dark-theme-contrast

Conversation

@BHUVANSH855
Copy link
Copy Markdown

The CDK dialog examples use a white dialog background (background: #fff) while inheriting text colors from the surrounding page theme.

In dark themes on material.angular.dev, this results in dialog content being rendered with very low contrast, making headings, labels, and body text difficult to read.

This change adds a foreground text color to the affected dialog example hosts using CanvasText, ensuring sufficient contrast against the existing white background while aligning with existing Angular Material usage of system colors.

Affected examples:

  • CDK Dialog Overview
  • Injecting data when opening a dialog
  • CDK Dialog Styling

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other

What is the current behavior?

Dialog content in several CDK dialog examples becomes difficult to read when viewed in dark themes because the dialog host uses a white background while text inherits colors intended for dark surfaces.

What is the new behavior?

The affected dialog examples explicitly use CanvasText for foreground text, providing readable contrast against the white dialog background across themes.

Does this PR introduce a breaking change?

  • Yes
  • No

@pullapprove pullapprove Bot requested review from crisbeto and tjshiu June 2, 2026 11:16
@angular-robot angular-robot Bot added area: docs Related to the documentation area: cdk/dialog labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cdk/dialog area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant