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/badge): move structural styles out of theme #28452

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

crisbeto
Copy link
Member

Historically we've had the structural styles for the badge in the theme, because Angular doesn't support adding styles to a directive. This can lead to duplicate CSS and can be problematic for M3.

These changes move the styles into a dummy component that is used to load the style only once per app.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jan 19, 2024
@crisbeto crisbeto force-pushed the badge-structural-styles branch 4 times, most recently from 5a81b0c to f7ff9fd Compare January 19, 2024 09:39
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

Would it be equivalent to putting this in the base mixin. which is meant to be called once per app?

src/material/badge/badge-module.ts Show resolved Hide resolved
@crisbeto
Copy link
Member Author

My understanding is that the base mixin is for tokens that can change based on the spec version. E.g. we emit the shape values there.

@andrewseguin
Copy link
Contributor

SG - I'm not too opinionated about it

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Jan 19, 2024
src/material/badge/badge.ts Outdated Show resolved Hide resolved
Historically we've had the structural styles for the badge in the theme, because Angular doesn't support adding styles to a directive. This can lead to duplicate CSS and can be problematic for M3.

These changes move the styles into a dummy component that is used to load the style only once per app.
@crisbeto crisbeto merged commit 23e2f3e into angular:main Jan 19, 2024
22 of 24 checks passed
crisbeto added a commit that referenced this pull request Jan 19, 2024
Historically we've had the structural styles for the badge in the theme, because Angular doesn't support adding styles to a directive. This can lead to duplicate CSS and can be problematic for M3.

These changes move the styles into a dummy component that is used to load the style only once per app.

(cherry picked from commit 23e2f3e)
@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 Feb 19, 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.

None yet

3 participants