Last active
July 12, 2021 23:38
-
-
Save jonasantonelli/56689f9248f3a76c541de46b5e948a54 to your computer and use it in GitHub Desktop.
Styled-Components: Readable style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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