Skip to content

Instantly share code, notes, and snippets.

@Chun-Lin
Last active August 22, 2018 07:46
Show Gist options
  • Save Chun-Lin/c13ff440e9f67562036b88a026bdcc39 to your computer and use it in GitHub Desktop.
Save Chun-Lin/c13ff440e9f67562036b88a026bdcc39 to your computer and use it in GitHub Desktop.
This is the component adding new css classes to adjust the style
import React from 'react'
import './content.css'
export default ({ skyblue }) => {
/* add new css classes */
let titleStyles = ['content__title']
if (skyblue) {
titleStyles.push('content--skyblue')
}
return (
<div className="content">
<div className="content__img" />
<div className="content__info">
<div className={titleStyles.join(' ')}>Cute Puppy</div>
<div className="content__description">
Sed ut voluptatem neque cumque. Qui sed ut itaque est doloribus qui.
Eos perferendis autem qui fugiat.
</div>
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment