【发布时间】:2020-02-09 12:52:44
【问题描述】:
import styled from '@emotion/styled'
import { css } from '@emotion/core'
const dynamicStyle = props =>
css`
color: ${props.color};
`
const Container = styled.div`
${dynamicStyle};
`
render(
<Container color="lightgreen">
This is lightgreen.
</Container>
)
如何使Container 对象样式如下?
const H1 = styled.h1(
{
fontSize: 20
},
props => ({ color: props.color })
)
【问题讨论】:
标签: reactjs styled-components emotion