Skip to content

Instantly share code, notes, and snippets.

@Marwil96
Created November 6, 2020 16:10
Show Gist options
  • Save Marwil96/ac19f17df8acdafb368f6dcae11d9ee7 to your computer and use it in GitHub Desktop.
Save Marwil96/ac19f17df8acdafb368f6dcae11d9ee7 to your computer and use it in GitHub Desktop.

Revisions

  1. Marwil96 created this gist Nov 6, 2020.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    import React from 'react';
    import styled from 'styled-components';

    const GridWrapper = styled.section`
    display: grid;
    grid-template-columns: ${props => `repeat(${props.columns}, 1fr)`};
    `

    const Grid = ({columns, children, style}) => {
    return (
    <GridWrapper columns={columns} style={style}>
    {children}
    </GridWrapper>
    )
    }

    export default Grid;