Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonasantonelli/6f8fe2c654c7c6e8fb05d1455980c2c7 to your computer and use it in GitHub Desktop.
Save jonasantonelli/6f8fe2c654c7c6e8fb05d1455980c2c7 to your computer and use it in GitHub Desktop.
Styled Components - Extending Style
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