Skip to content

Instantly share code, notes, and snippets.

@jonasantonelli
Created July 12, 2021 23:46
Show Gist options
  • Save jonasantonelli/e4b55af08c0e7e1a7ebfc59b16073212 to your computer and use it in GitHub Desktop.
Save jonasantonelli/e4b55af08c0e7e1a7ebfc59b16073212 to your computer and use it in GitHub Desktop.
Styled Component - Referring to other components
import styled from 'styled-components'
const Item = styled.li`
color: cadetblue;
`;
const UnorderedList = styled.ul`
list-style: none;
${Item} {
margin-bottom: 7px;
}
`;
export default () => (
<UnorderedList>
<Item>...</Item>
<Item>...</Item>
</UnorderedList>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment