Skip to content

Instantly share code, notes, and snippets.

@mikeyamadeo
Last active August 24, 2016 23:04
Show Gist options
  • Save mikeyamadeo/338939aafdfc588130f1a77da1c59d50 to your computer and use it in GitHub Desktop.
Save mikeyamadeo/338939aafdfc588130f1a77da1c59d50 to your computer and use it in GitHub Desktop.

Photo/style.css

/* block */
.Photo {}

/* element */
.Photo__img {}

/* modifier */
.Photo--large {}

Photo/index.js

import './style' // tyvm Webpack
import React from 'react'
import cn from 'classnames'

const Photo = ({src, alt, isLarge}) =>
  <div {...{ className: cn({
    Photo: true,
    'Photo--large': isLarge})
  }}>
    <img {...{ src, alt,
      className: 'Photo__img' }}
    />
  </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment