-
-
Save martinwairegi/f9b3d86b0f12e491bc8210012db82ba1 to your computer and use it in GitHub Desktop.
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 styled, { css } from "styled-components"; | |
const GridBlock = styled.div` | |
${props => | |
props.size && | |
css` | |
width: ${props.size - Math.floor(props.size / 10)}px; | |
height: ${props.size - Math.floor(props.size / 10)}px; | |
border: ${Math.floor(props.size / 20)}px solid black; | |
`}; | |
${props => | |
props.color && | |
css` | |
background-color: rgb(${props.color}); | |
`}; | |
`; | |
export default GridBlock; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment