The first child and last child selectors in my above code don’t work.
Rahul Yadav
1

import styled from 'react-emotion'
const StyledP = styled.p`
color: turquoise;
&:last-child {
color:green;
}
&:first-child {
color: red;
}
`
render(
<div>
<StyledP>First</StyledP>
<StyledP>Second</StyledP>
<StyledP>third</StyledP>
<StyledP>last</StyledP>
</div>
)

That should work.

https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child

https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child