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

docs-bug(Theming Angular Material): theme overrides vs css variables #29431

Open
whynotavailable opened this issue Jul 14, 2024 · 1 comment
Open
Labels
area: theming docs This issue is related to documentation P4 A relatively minor issue that is not relevant to core functions

Comments

@whynotavailable
Copy link

whynotavailable commented Jul 14, 2024

Documentation Feedback

There exists seemingly two ways to implement MDC (or MAT) tokens in scss. The first way is by directly using the variables. Such as this.

mat-toolbar {
  --mat-toolbar-container-background-color: #{mat.get-theme-color($my-theme, primary-container)};
  --mat-toolbar-container-text-color: #{mat.get-theme-color($my-theme, on-primary-container)};
}

The second way is to use the override mixins to generate the appropriate tokens (especially neat when the component uses both MDC and MAT tokens) like this.

mat-toolbar {
  @include mat.toolbar-overrides((
    container-background-color: mat.get-theme-color($my-theme, primary-container),
    container-text-color: mat.get-theme-color($my-theme, on-primary-container)
  ))
}

I can find no places where these override mixins are used or documented. Is there a preference towards one or the other?

Affected documentation page

https://material.angular.io/guide/theming#granular-customizations-with-css-custom-properties

@whynotavailable whynotavailable added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Jul 14, 2024
@hhaasbroek
Copy link
Contributor

please assign this one to me

@amysorto amysorto added P4 A relatively minor issue that is not relevant to core functions area: theming and removed needs triage This issue needs to be triaged by the team labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: theming docs This issue is related to documentation P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

3 participants