【问题标题】:Styled-Components and Template Literals样式化组件和模板文字
【发布时间】: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


    【解决方案1】:

    【讨论】:

    • 回答了✅谢谢。
    猜你喜欢
    • 2021-02-22
    • 1970-01-01
    • 2018-02-26
    • 2012-10-06
    • 2018-09-17
    • 1970-01-01
    • 2021-06-07
    • 2020-10-23
    • 2018-11-29
    相关资源
    最近更新 更多