Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@evanrs/map-props

evanrs15ISC1.1.0

Maps props to styles

react, styled, map props

readme

Select css given by

  • mapValue[props[prop]]
  • mapValue(props[prop], prop, props)
  • mapValue
  • props[prop]
   <StyledComponent hide={!visible} />
   mapProps({
       color: (propValue, propName, ownProps) =>
           css`color: ${propValue}`
   })
   mapProps({
       intent: {
           alert: css`color: magenta`,
           success: css`color: green`,
           default: css`color: blue`,
       }
   })
   mapProps({
       block: css`
           display: block;
       `
   })