Skip to content

Comments

docs(theming): mention mat.theme mixin in M2 to M3 migration guide#32833

Open
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/m2-migration-update-api-refs
Open

docs(theming): mention mat.theme mixin in M2 to M3 migration guide#32833
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/m2-migration-update-api-refs

Conversation

@yogeshwaran-c
Copy link

What kind of change does this PR introduce?

Documentation improvement

What is the current behavior?

The M2 to M3 migration section in the Material 2 theming guide only references
mat.define-theme as the way to create an M3 theme. Since Angular Material v19,
the recommended approach is the mat.theme mixin, but the migration guide does
not mention it. This causes confusion for developers following the migration
guide who then find different APIs in the main theming guide.

Closes #30266

What is the new behavior?

Updates the "Pass a new M3 theme in your global theme styles" section to:

  • Show the mat.theme mixin as the primary recommended approach for v19+
  • Include a code example using the mat.theme mixin
  • Explain that mat.define-theme is still available as an alternative for use
    with backwards compatibility helpers like color-variants-backwards-compatibility
  • Link to the main theming guide for full details

Additional context

The mat.define-theme function still exists and is valid for creating theme
objects that can be passed to individual component mixins. The mat.theme mixin
is the v19+ approach that directly emits CSS variables. Both are correct, but
the migration guide should mention the preferred approach first.

@angular-robot angular-robot bot added area: docs Related to the documentation area: theming labels Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation area: theming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs-bug(theming): Update M2 theme guide with new theme mixin

1 participant