Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonasantonelli/56689f9248f3a76c541de46b5e948a54 to your computer and use it in GitHub Desktop.
Save jonasantonelli/56689f9248f3a76c541de46b5e948a54 to your computer and use it in GitHub Desktop.
Styled-Components: Readable style
import styled, { css } from 'styled-components'
// Readable Style
const style = css`
list-style: none;
li {
margin-bottom: 7px;
}
`
const UnorderedList = styled(({ children, ...rest }) => (
<ul {...rest}>
{ children }
</ul>
))`
${style}
`
export default () => (
<UnorderedList>
<li>...<li>
</UnorderedList>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment