Skip to content

Instantly share code, notes, and snippets.

@antoinejaussoin
Created March 23, 2018 11:59
Show Gist options
  • Save antoinejaussoin/3332d6917e98850d8da8b31838688ac7 to your computer and use it in GitHub Desktop.
Save antoinejaussoin/3332d6917e98850d8da8b31838688ac7 to your computer and use it in GitHub Desktop.
Card Component rewritten with Styled Components
import React from 'react';
import styled from 'styled-components';
const Container = styled.div`
display: flex;
width: 100px;
height: 150px;
border: 3px solid ${props => props.color};
border-radius: 15px;
justify-content: space-around;
font-size: 5em;
color: ${props => props.color};
`;
const Content = styled.div`
align-self: center;
`;
const Card = ({ children, color = '#ff867c' }) => (
<Container color={color}>
<Content>
{children}
</Content>
</Container>
);
export default Card;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment