.body > :last-child {
margin-bottom: 0;
}
.theme-red .txt {
color: red;
}
Purely using JS will require a shift in thinking. For example, let's say we want to apply a top margin to all the list items but one. Intead of:
.li:not(:first-child) {
margin-top: .5em;
}
We would use JS to conditionally render margin:
<ul>
{items.map((item, i) =>
<li style={i > 0 ? {marginTop: '.5em'} : {}}>
{item.name}
</li>
)}
</ul>