Skip to content

Instantly share code, notes, and snippets.

@srph
Last active June 18, 2018 03:36
Show Gist options
  • Save srph/65b115b8f07c167ce6786443489a325e to your computer and use it in GitHub Desktop.
Save srph/65b115b8f07c167ce6786443489a325e to your computer and use it in GitHub Desktop.
JS: Organizing styled-components
const styling = {
Container: style.div`
padding: 16px;
${props => props.isBig && css`
padding: 32px;
`}
`,
Heading: styled.div`
display: flex;
`,
HeadingButton: styled.div`
margin-left: auto;
`
}
const Card = <styling.Container>
<styling.Heading>
<styling.HeadingButton>
<button />
</styling.HeadingButton>
</syling.Heading>
</styling.Container>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment