Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 536 Bytes

File metadata and controls

29 lines (27 loc) · 536 Bytes
id redux-props
title Props

Pass props to the reactCSS method and they will automatically activate any classes that match 'key-value' or 'key' if value is true:

const Component = (props) => {
  const styles = reactCSS({
    'default': {
      card: {
        // styles always applied
      },
    },
    'zIndex-2': {
      card: {
        // styles for <Component zIndex="2" />
      }
    },
    'hover': {
      card: {
        // styles for <Component hover={ true } />
      }
    }
  }, props)

  ...
}