【发布时间】:2022-01-23 18:56:06
【问题描述】:
我无法在悬停时更改此 FAB 的颜色。使用这些设置,颜色和悬停的颜色显示为禁用(全灰色)。
这是代码:
const style = {
margin: 0,
top: "auto",
right: 20,
bottom: 20,
left: "auto",
position: "fixed",
color: "primary",
zIndex: 20,
"&:hover": {
color: "yellow",
},
};
return (
<div style={{ height: "100vh", width: "100vw" }}>
<ReactFlow elements={graph} />
<Fab aria-label="Next Level" style={style} onClick={reqNextLevel}>
<AddIcon style={{ fill: "white" }} />
</Fab>
</div>
);
【问题讨论】:
标签: reactjs colors material-ui styles floating-action-button