-
-
Save bernharduw/bff9c901934ebc3f903d83b3b970f2fa to your computer and use it in GitHub Desktop.
reactcss playground
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 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