Skip to content

Instantly share code, notes, and snippets.

@bernharduw
Forked from casesandberg/list-item.js
Last active December 7, 2016 02:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernharduw/bff9c901934ebc3f903d83b3b970f2fa to your computer and use it in GitHub Desktop.
Save bernharduw/bff9c901934ebc3f903d83b3b970f2fa to your computer and use it in GitHub Desktop.
reactcss playground
import React from 'react';
import styled from 'styled-components';
const Item = styled.div`
margin-top: 1px;
padding: 15px;
background: #333;
${({first}) => first ? `
margin-top: 0;
border-radius: 2px 2px 0 0;
` : ''}
${({last}) => last ? `
border-radius: 0 0 2px 2px;
` : ''}
${({hover}) => hover ? `
background: #444;
` : ''}
`;
const Label = styled(Text)`
size: small;
${({hover}) => hover ? `
weight: bold;
` : ''}
`;
const ListItem = ({label, first, last, hover}) => (
<Item first={first} last={last} hover={hover}>
<Label hover={hover}>
{ label }
</Label>
</Item>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment