Last active
March 9, 2016 12:11
-
-
Save axross/63d40a18bdcb3ac5274c to your computer and use it in GitHub Desktop.
medium
This file contains 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
const SomeComponent = React.createClass({ | |
render() { | |
const items = [1, 2, 3, 4, 5, 6, 7, 8, 9].map((num, i) => { | |
const className = "someComponent__list__item" + i % 2 === 1 ? | |
"someComponent__list__item--odd" : ""; | |
return ( | |
<li className={className}> | |
{num} | |
</li> | |
); | |
}); | |
return ( | |
<div className="someComponent"> | |
<ul className="someComponent__list"> | |
{items} | |
</ul> | |
</div> | |
); | |
} | |
}); |
This file contains 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
.someComponent | |
&__list | |
padding 0 | |
list-style none | |
&__item | |
line-height 1.5 | |
&--odd | |
background-color #efefef |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment