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

bug(button): FAB Button without elevation #29310

Closed
1 task
mrmokwa opened this issue Jun 24, 2024 · 2 comments
Closed
1 task

bug(button): FAB Button without elevation #29310

mrmokwa opened this issue Jun 24, 2024 · 2 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@mrmokwa
Copy link

mrmokwa commented Jun 24, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

We cannot use FAB button without elevation.

Navigation Rail in MD3 supports an FAB button in the top, but doesn't require elevation.

https://m3.material.io/components/navigation-rail/guidelines

If we try to remove the elevation, after clicking the button, the elevation reappers.

.mat-mdc-fab {
  box-shadow: none;
  &:hover {
    box-shadow: none;
  }
}

Since this PR we can use the elevation helpers in v18.

I'd sugest removing the elevation, and let the user chooses when to apply it... but this, will probably break many apps/tests.
Perhaps an input option to remove it?

You can check an example in the MD3 site.

image

Reproduction

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

Expected Behavior

FAB shouldn't have elevation by default.

Actual Behavior

We are unable to remove elevation from a FAB button.

Environment

  • Angular: 18
  • CDK/Material: 18
@mrmokwa mrmokwa added the needs triage This issue needs to be triaged by the team label Jun 24, 2024
@andrewseguin
Copy link
Contributor

FABs do have an elevation by default: https://m3.material.io/components/floating-action-button/specs

You can remove the box-shadow by overriding the variables used to define the styles:

  --mdc-fab-container-elevation-shadow: 0;
  --mdc-fab-hover-container-elevation-shadow: 0;
  --mdc-fab-pressed-container-elevation-shadow: 0;
  --mdc-fab-focus-container-elevation-shadow: 0;

@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 Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

2 participants