如何更正 CSS 文件中的 $ 标记?
How to correct $ mark in CSS file?
我的项目中有 CSS const,然后我在显示错误的最后一行插入“$”符号。我该如何解决?
const NavBox = (props: { children: React.ReactNode }) => { return (
<div
css={css`
display: flex;
height: 100%;
justify-content: flex-end;
align-items: center;
@media (max-width: 768px) {
flex-direction: column;
position: fixed;
width: 100%;
justify-content: flex-start;
padding-top: 10vh;
background-color: #fff;
transition: all 0.3s ease-in;
top: 8vh;
left: ${props => (props.open ? "-100%" : "0")};
}
`}
{...props}
></div>
)
}
删除 lambda 并执行:
left: ${props.open ? "-100%" : "0"};
我的项目中有 CSS const,然后我在显示错误的最后一行插入“$”符号。我该如何解决?
const NavBox = (props: { children: React.ReactNode }) => { return (
<div
css={css`
display: flex;
height: 100%;
justify-content: flex-end;
align-items: center;
@media (max-width: 768px) {
flex-direction: column;
position: fixed;
width: 100%;
justify-content: flex-start;
padding-top: 10vh;
background-color: #fff;
transition: all 0.3s ease-in;
top: 8vh;
left: ${props => (props.open ? "-100%" : "0")};
}
`}
{...props}
></div>
) }
删除 lambda 并执行:
left: ${props.open ? "-100%" : "0"};