【发布时间】:2021-07-06 07:27:28
【问题描述】:
有人可以帮忙解释一下styled.a`aasdasd` 是如何工作的吗?这是有效的 JS 吗?这是什么意思?这是来自 styled-components库的代码sn-p?
const Button = styled.a`
/* This renders the buttons above... Edit me! */
display: inline-block;
border-radius: 3px;
padding: 0.5rem 0;
margin: 0.5rem 1rem;
width: 11rem;
background: transparent;
color: white;
border: 2px solid white;
/* The GitHub button is a primary button
* edit this to target it specifically! */
${props => props.primary && css`
background: white;
color: black;
`}
`
【问题讨论】:
标签: javascript css styled-components