Skip to content

fix(multiple): use inline m2 token definitions #31359

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented Jun 14, 2025

Defines M2 theme tokens (CSS vars) inline instead of creating a new selector block

// Theme file:
html {
  @include mat.button-theme($theme);
  @include mat.card-theme($theme);
  @include mat.checkbox-theme($theme);
}

Before, this would have split each component into its own html block:

html {
  // button token CSS variable definitions
}

html {
  // card token CSS variable definitions
}

html {
  // checkbox token CSS variable definitions
}

With this change, these will be grouped together:

html {
  // button token CSS variable definitions
  // card token CSS variable definitions
  // checkbox token CSS variable definitions
}

For some users, this will surface a Sass warning about mixed-decls. This was previously being avoided because the CSS created the variables in subsequent selector blocks, but are now inline.

@andrewseguin andrewseguin added the target: minor This PR is targeted for the next minor release label Jun 14, 2025
@andrewseguin andrewseguin force-pushed the create-tokens-more branch 2 times, most recently from ea0ad82 to 501d977 Compare June 15, 2025 13:20
@andrewseguin andrewseguin marked this pull request as ready for review June 16, 2025 11:26
@andrewseguin andrewseguin requested a review from a team as a code owner June 16, 2025 11:26
@andrewseguin andrewseguin requested review from adolgachev, mmalerba, crisbeto and wagnermaciel and removed request for a team June 16, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/autocomplete target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants