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

fix(material/core): theming validation for m2 themes firing incorrectly #28707

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

crisbeto
Copy link
Member

Fixes that theming validation for M2 themes was firing incorrectly, because the validation code was going through the get-color-config, get-density-config and get-typography-config functions which in turn were reading the internalized version of the theme where all the values were the same. Since Sass maps are immutable, they were being compared based on their values and always considered as the same theme.

Fixes that theming validation for M2 themes was firing incorrectly, because the validation code was going through the `get-color-config`, `get-density-config` and `get-typography-config` functions which in turn were reading the internalized version of the theme where all the values were the same. Since Sass maps are immutable, they were being compared based on their values and always considered as the same theme.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Mar 10, 2024
@crisbeto crisbeto requested a review from mmalerba March 10, 2024 14:26
$color-config: get-color-config($theme);
$density-config: get-density-config($theme);
$typography-config: get-typography-config($theme);
$color-config: map.get($theme, $_internals, m2-config, color) or get-color-config($theme);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could expose this function internally if you want: https://github.com/angular/components/blob/main/src/material/core/theming/_m2-inspection.scss#L44, would probably make the logic here slightly simpler. Though this is fine too

@crisbeto crisbeto removed the request for review from jelbourn March 11, 2024 16:48
@crisbeto crisbeto self-assigned this Mar 11, 2024
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Mar 11, 2024
@crisbeto crisbeto merged commit e524567 into angular:main Mar 11, 2024
25 of 27 checks passed
crisbeto added a commit that referenced this pull request Mar 11, 2024
…ly (#28707)

Fixes that theming validation for M2 themes was firing incorrectly, because the validation code was going through the `get-color-config`, `get-density-config` and `get-typography-config` functions which in turn were reading the internalized version of the theme where all the values were the same. Since Sass maps are immutable, they were being compared based on their values and always considered as the same theme.

(cherry picked from commit e524567)
crisbeto added a commit that referenced this pull request Mar 11, 2024
…ly (#28707)

Fixes that theming validation for M2 themes was firing incorrectly, because the validation code was going through the `get-color-config`, `get-density-config` and `get-typography-config` functions which in turn were reading the internalized version of the theme where all the values were the same. Since Sass maps are immutable, they were being compared based on their values and always considered as the same theme.

(cherry picked from commit e524567)
@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 Apr 11, 2024
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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants