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

feat(button): add support for filled tonal button same as in M3 spec #28809

Closed
eneajaho opened this issue Apr 2, 2024 · 7 comments · Fixed by #30638
Closed

feat(button): add support for filled tonal button same as in M3 spec #28809

eneajaho opened this issue Apr 2, 2024 · 7 comments · Fixed by #30638
Assignees
Labels
area: material/button feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@eneajaho
Copy link
Contributor

eneajaho commented Apr 2, 2024

Feature Description

https://m3.material.io/components/buttons/guidelines#07a1577b-aaf5-4824-a698-03526421058b

image

Use Case

No response

@eneajaho eneajaho added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Apr 2, 2024
@amysorto amysorto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/button and removed needs triage This issue needs to be triaged by the team labels May 7, 2024
@bradleybeighton
Copy link

+1

@vulture9
Copy link

vulture9 commented Sep 9, 2024

upvoted missing core feature should be implemented.

@MariusMoeOlsen
Copy link

Yes, I also need this.

@nasser-alkhateeb
Copy link

+1. This feature should be implemented. In the meantime, we can use the following:

button.mat-tonal-button {
  background-color: var(--sys-secondary-container);
  color: var(--mat-app-on-secondary-container);
}

<button class="mat-tonal-button" mat-button>
</button>

@JWess
Copy link

JWess commented Feb 21, 2025

+1. This feature should be implemented. In the meantime, we can use the following:

button.mat-tonal-button {
  background-color: var(--sys-secondary-container);
  color: var(--mat-app-on-secondary-container);
}

<button class="mat-tonal-button" mat-button>
</button>

In v19, I had to use these slightly differently named CSS vars:
--mat-sys-secondary-container
--mat-sys-on-secondary-container

@JWess
Copy link

JWess commented Mar 6, 2025

It's nearly impossible to follow the M3 spec without having access to a tonal button. This seems like a major issue.

@JWess
Copy link

JWess commented Mar 6, 2025

This is the best workaround I found for now. It piggybacks on the extended fab button, so you're still inside the theme and get appropriate styling for hover/focus/press and probably other things I've not thought of.

<button class="tonal"
  mat-fab extended
>
  Button Text
</button>
.tonal.mat-mdc-extended-fab {
  @include mat.fab-overrides((
    extended-container-height: 40px,
    extended-container-shape: var(--mat-sys-corner-full),
    extended-container-elevation-shadow: var(--mat-sys-level0),
    extended-focus-container-elevation-shadow: var(--mat-sys-level0),
    extended-hover-container-elevation-shadow: var(--mat-sys-level0),
    extended-pressed-container-elevation-shadow: var(--mat-sys-level0),
  ));
}

crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 17, 2025
Adds support for the tonal button appearance from the spec. It can be enabled by setting `matButton="tonal"` on the button.

Fixes angular#28809.
@crisbeto crisbeto self-assigned this Mar 17, 2025
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 17, 2025
Adds support for the tonal button appearance from the spec. It can be enabled by setting `matButton="tonal"` on the button.

Fixes angular#28809.
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 18, 2025
Adds support for the tonal button appearance from the spec. It can be enabled by setting `matButton="tonal"` on the button.

Fixes angular#28809.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/button feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants