Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 362 Bytes

styled-with-object.md

File metadata and controls

19 lines (14 loc) · 362 Bytes

Objects With styled

styled can also take objects or a function that returns an object. This API was inspired by glamorous.

import styled from 'react-emotion'

const H1 = styled.h1(
  {
    fontSize: 20
  },
  (props) => ({ color: props.color })
)

const H2 = styled(H1)(
  { fontSize: '40px' }
)