Skip to content

Conversation

@crisbeto
Copy link
Member

Includes the following changes:

fix(material-experimental/theming): avoid re-emitting the same tokens from the backwards-compatibility styles

Currently the color variant backwards-compatibility styles emit all tokens, even though they were likely emitted already by the theme. This ends up increasing the theme size by about 50kb.

These changes add a emit-overrides-only parameter to the token utilities and use it to only emit the palette-specific styles from the backwards-compatibility mixin.

feat(material/core): add prebuilt themes based on M3

Adds four new prebuilt themes that are using Material Design 3.

… from the backwards-compatibility styles

Currently the color variant backwards-compatibility styles emit all tokens, even though they were likely emitted already by the theme. This ends up increasing the theme size by about 50kb.

These changes add a `emit-overrides-only` parameter to the token utilities and use it to only emit the palette-specific styles from the backwards-compatibility mixin.
@crisbeto crisbeto added target: major This PR is targeted for the next major release merge: preserve commits When the PR is merged, a rebase and merge should be performed labels Mar 26, 2024
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Mar 26, 2024
Adds four new prebuilt themes that are using Material Design 3.
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

At some point I think we'll want to deprecate the color="..." API on the components, and at that point we might want to introduce a simpler class-based API to the predefined themes. I'm imagining something like:

<div class="mat-predefined-secondary">
  All components in here are secondary color
  <mat-checkbox />
  <mat-radio />
</div>

The mat-predefined-secondary would be a class you could add to any element to cause all child components to get secondary coloring. For now I think just including the back-compat styles is fine, but we'll want to revisit this later.

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Mar 26, 2024
@crisbeto crisbeto merged commit 4473a37 into angular:main Mar 26, 2024
@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 26, 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 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