Skip to content

Instantly share code, notes, and snippets.

@chetanraj
Last active February 12, 2021 16:55
Show Gist options
  • Save chetanraj/ea38c8a127534b819848af790251897d to your computer and use it in GitHub Desktop.
Save chetanraj/ea38c8a127534b819848af790251897d to your computer and use it in GitHub Desktop.
import styled from 'styled-components';
import { border, color, compose, flexbox, layout, position, shadow, space, typography } from 'styled-system';
export const Div = styled('div')(
compose(border, space, layout, typography, color, position, shadow, flexbox)
);
export const Flex = styled(Div)`
display: flex;
`;
export const Button = styled('button')(
compose(border, space, layout, typography, color, position, flexbox)
);
// and then extend the Button function to create multiple variants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment