【发布时间】:2018-06-11 01:38:52
【问题描述】:
如何将多背景颜色应用于材质 UI 小吃栏?我尝试了如下所述的线性渐变,但它不起作用。
import Snackbar from 'material-ui/Snackbar';
const bodyStyle = {
border: `2px solid ${config.actualWhite}`,
minWidth: '50%',
maxWidth: '100%',
height:'55px',
backgroundColor: 'linear-gradient(to right bottom, #00897B, #FFE082)',
fontFamily: config.fontFamily,
fontStyle: config.fontStyle,
fontWeight: config.fontWeight,
fontSize: config.fontSize
}
<Snackbar
open={this.state.openLogout}
message="You are Successfuly loggedout! Thanks for being part of web Family!"
autoHideDuration={4000}
bodyStyle={bodyStyle}
action="Close"
onRequestClose={this.handleRequestClose}
onActionTouchTap={this.handleRequestClose}
style={myTheme.snackbarfromTop}
/>
【问题讨论】:
-
将 backgroundColor 更改为具有线性渐变颜色的背景对我有用。附上参考的小吃店图片。
标签: javascript css reactjs material-ui snackbar