Skip to content

Instantly share code, notes, and snippets.

@axross
Last active March 9, 2016 12:11
Show Gist options
  • Save axross/63d40a18bdcb3ac5274c to your computer and use it in GitHub Desktop.
Save axross/63d40a18bdcb3ac5274c to your computer and use it in GitHub Desktop.
medium
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>
);
}
});
.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