【发布时间】:2021-09-19 13:36:57
【问题描述】:
**嗨,所以我认为 Vercel 正在覆盖我的 css,它在本地工作得很好,但有些样式在 Vercel Env 上一次没有应用。所以当我应用 !important 时背景颜色起作用了。我现在正在尝试在 zIndex 上应用相同的方法,但它不起作用。请协助**
类型“${number} !important”不可分配给类型“ZIndexProperty | PropsFunc unknown, ZIndexProperty>'.
类型“字符串”不可分配给类型“ZIndexProperty | PropsFunc unknown, ZIndexProperty>'.
类型“${number} !important”不可分配给类型“自动”。
类型 'string' 不可分配给类型 '"auto"'
const drawerWidth = 280;
const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
display: 'flex'
},
appBar: {
zIndex: `${theme.zIndex.drawer + 1} !important`,
transition: theme.transitions.create(['width', 'margin'], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen
}),
backgroundColor: `${theme.palette.secondary.contrastText} !important`,
height: 80,
paddingTop: theme.spacing(2),
display: 'flex',
flexDirection: 'column',
justifyContent: 'center'
},```
【问题讨论】:
标签: css reactjs typescript next.js styled-components