Created
May 5, 2017 03:09
-
-
Save oojr/c70c29ec175b4319a0c732cbdaea24b0 to your computer and use it in GitHub Desktop.
css styles example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.thumbnail { | |
margin: 5px, | |
padding: 5px, | |
background-color: #91969A, | |
border-radius: 3px, | |
min-width: 66px | |
} | |
.sponsored { | |
background-color: #F9BF3B, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import classNames from 'classnames' | |
import './style-in-css.css' // assume has the .thumbnail and .sponsored class declaration | |
class Post extends React.Component { | |
render(){ | |
// css is seperated but still need javascript | |
const thumbnailClass = classNames({ | |
'thumbnail': true, | |
'sponsored': this.props.post.type === 'sponsored' | |
}); | |
<div> | |
<div className={thumbnailClass}> | |
</div> | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment