📜  样式化组件条件悬停 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:19.499000             🧑  作者: Mango

代码示例1
import { css, styled } from 'styled-components'

styled.div`
   ${props => props.shouldHover && css`
      &:hover {
        background: 'red';
      }
   `}
`