[Fab] Floating action buttion doesn't support colors #30665
Labels
component: Fab
The React component.
design: material
This is about Material Design, please involve a visual or UX designer in the process
new feature
New feature or request
Duplicates
Latest version
Current behavior 😯
Fab
component doesn't support any color other thanprimary
orsecondary
. This is inconsistent with behaviour of other components likeButton
for example.This is where the issue lies:
https://github.com/mui-org/material-ui/blob/master/packages/mui-material/src/Fab/Fab.js#L113-L136
Instead of
theme.palette.primary.main
there should betheme.palette[ownerState.color].main
etc. (some conditions around need to be changed as well here)Expected behavior 🤔
color
property ofFab
should be consistent with that of other components (likeButton
and many other) and accept all defined colors.Steps to reproduce 🕹
https://codesandbox.io/s/customcolor-material-demo-forked-l5fml?file=/demo.js
Context 🔦
No response
Your environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: