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): add optional warning for incomplete themes #25654

Merged
merged 1 commit into from Sep 18, 2022

Conversation

andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented Sep 18, 2022

Add a flag that can be transformed to "true" internally that produces an error if users call a theming function with an incomplete map.

For example, calling mat.button-typography($theme) that doesn't have typography will error.

Another example, calling mat.button-theme($theme) without color, typography, and density will error.

For cases where users do not want to include certain styles, e.g. typography, they should directly call "-color()" and "-density()" and skip "-typography()"

The intent of this is to standardize theming configurations internally so that all apps explicitly declare what they want to include in their theming, making it more clear what they are not including as well. All apps will default to typography: null or density: 0 if it is missing in their theme config

@andrewseguin andrewseguin added the target: patch This PR is targeted for the next patch release label Sep 18, 2022
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Nice

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

src/material/core/theming/_theming.scss Outdated Show resolved Hide resolved
@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Sep 18, 2022
@andrewseguin andrewseguin self-assigned this Sep 18, 2022
@andrewseguin andrewseguin added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Sep 18, 2022
@andrewseguin andrewseguin merged commit c14d176 into angular:main Sep 18, 2022
@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 Oct 19, 2022
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: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants