Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for custom component theming with M3 #27617

Merged
merged 8 commits into from
Aug 14, 2023

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Aug 9, 2023

A new API for this is necessary because the existing APIs (e.g. mat.get-color-from-palette) require the user to have some knowledge of how the theme object is structured. With the M3 theme objects, we made he decision that the theme object structure should be opaque to the user.

I will do a followup PR to add support for using the same API to access values from M2 theme objects. This will allow users to move their custom components on to the new API before updating to use an M3 theme.

With the new theming APIs, I'm focusing on trying to catch common errors a user might make and report helpful error messages rather than the $map: null is not a map errors that our previous APIs often threw. I've added tests to cover these error cases as well as the expected cases.

I'm introducing the APIs as private in this PR, but will do a followup once they have M2 theme support to make them public.

@mmalerba mmalerba added the target: major This PR is targeted for the next major release label Aug 9, 2023
@mmalerba mmalerba requested a review from jelbourn as a code owner August 9, 2023 23:02
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Aug 9, 2023
@mmalerba mmalerba added the merge: preserve commits When the PR is merged, a rebase and merge should be performed label Aug 10, 2023
@mmalerba mmalerba force-pushed the m3-theming-api branch 3 times, most recently from ba52651 to 74718a1 Compare August 11, 2023 15:12
@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Aug 14, 2023
@mmalerba mmalerba merged commit bbc807a into angular:main Aug 14, 2023
11 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit merge: preserve commits When the PR is merged, a rebase and merge should be performed target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants