Skip to content

Instantly share code, notes, and snippets.

@LukeSmetham
Last active October 29, 2020 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LukeSmetham/2fdb901b5fa5c1e4dc1a880642180d62 to your computer and use it in GitHub Desktop.
Save LukeSmetham/2fdb901b5fa5c1e4dc1a880642180d62 to your computer and use it in GitHub Desktop.
const List = styled.div`
// Target immediate children of List that have siblings
& > * + * {
margin-top: 16px;
}
// Target any List components that are the child of an <article>
article & {
color: white;
}
// Target any adjacent Lists
& + & {
margin-top: 16px;
}
// Target the List when hovered
&:hover {
background-color: red;
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment