Skip to content

Instantly share code, notes, and snippets.

@martinwairegi
Created Jul 5, 2022
Embed
What would you like to do?
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