docs(theming): mention mat.theme mixin in M2 to M3 migration guide#32833
Open
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
Open
docs(theming): mention mat.theme mixin in M2 to M3 migration guide#32833yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-themeas the way to create an M3 theme. Since Angular Material v19,the recommended approach is the
mat.thememixin, but the migration guide doesnot 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:
mat.thememixin as the primary recommended approach for v19+mat.thememixinmat.define-themeis still available as an alternative for usewith backwards compatibility helpers like
color-variants-backwards-compatibilityAdditional context
The
mat.define-themefunction still exists and is valid for creating themeobjects that can be passed to individual component mixins. The
mat.thememixinis the v19+ approach that directly emits CSS variables. Both are correct, but
the migration guide should mention the preferred approach first.