Last active
July 12, 2021 23:38
-
-
Save jonasantonelli/6f8fe2c654c7c6e8fb05d1455980c2c7 to your computer and use it in GitHub Desktop.
Styled Components - Extending 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'; | |
/** | |
* Extending from another component | |
*/ | |
const List = styled.ul` | |
list-style: auto; | |
li { | |
text-transform: uppercase; | |
margin-bottom: 8px; | |
} | |
`; | |
const UnorderedList = styled(List)` | |
list-style: circle; | |
`; | |
export default () => ( | |
<UnorderedList> | |
<li>...<li> | |
</UnorderedList> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment