【发布时间】:2020-10-29 08:57:34
【问题描述】:
我目前正在使用来自 MUI 的 ListItem。我试图在它处于活动状态时使其更大胆,但似乎 font-weight 不起作用。
代码见下文。
<List
component='nav'
aria-label='main mailbox folders'
>
<ListItem
button
component={NavLink}
exact
to='/accounts'
activeClassName={classes.active}
className={classes.appBarNavButtons}
>
<MyAccountsIcon />
<ListItemText
style={{ marginLeft: '20px', fontSize: 'large' }}
primary='My Accounts'
/>
</ListItem>
</List>
风格:
appBarNavButtons: {
color: colors.blueGrey[800],
textTransform: 'none',
letterSpacing: 0,
},
active: {
color: '#0056b3',
fontWeight: 'bolder',
'& $icon': {
color: theme.palette.primary.main,
}
}
任何帮助或建议将不胜感激。
【问题讨论】:
标签: css reactjs material-ui