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(button): I don't understand how to use most of design tokens #30425

Open
roma2341 opened this issue Jan 31, 2025 · 2 comments
Open

docs-bug(button): I don't understand how to use most of design tokens #30425

roma2341 opened this issue Jan 31, 2025 · 2 comments
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team

Comments

@roma2341
Copy link

roma2341 commented Jan 31, 2025

Documentation Feedback

For example i see outlined-hover-state-layer-opacity, what is it, what values does it accept (opacity or color)? i tried to set it and it doesn't change anything. How i should properly style button for :hover ? Now i'm using something like this:

.mdc-button:hover {
  @include mat.button-overrides(
    (
      filled-container-color: var(--colors-main-40),
    )
  );
}

But i don't like that i forced to use class name "mdc-button" that can be changed.
Maybe there are figma or something i can play around with these design tokens because now i blind and everyting is unclear and i think that i hack new tokens system.

Affected documentation page

https://material.angular.io/components/button/styling

@roma2341 roma2341 added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Jan 31, 2025
@bdirito
Copy link

bdirito commented Feb 4, 2025

I think I can help you a bit on this; though I do agree that this is a weakness in the current Angular Material documentation. Material exists as a specification outside of Angular (https://m3.material.io/). So you can use the 'base' material documents to get a deeper sense of what exactly something like filled-container-color might mean.

For that particular token I am pretty sure filled-container-color refers to what you can see in the 'Filled Button' tokens under 'Enabled > Enabled / Container / Filled button container color' (https://m3.material.io/components/buttons/specs#0b1b7bd2-3de8-431a-afa1-d692e2e18b0d). This is not great; I know of no way to deterministically map a given angular material 'style override token' as documented on https://material.angular.io/components/button/styling to those documented on the material page; how do you know for sure that angular material's filled-container-color maps to material's Filled button container color? The pattern to map from one to the other is implied but not actually explicitly spelled out anywhere as far as I can tell.

Is there some other site that is better at spelling out the full and explicit material design tokens and linking those to a UI specification? Any such external documentation should either be copied or even just linked on the Angular Material documentation.

@richardsengers
Copy link

Agree on this one... shapes is one of those design tokens which is unclear on how to use it. The M3 docs say you can use small, medium, large etc
https://m3.material.io/styles/shape/overview

But apparently in Material design you should use pixels as a shape value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

3 participants