Last active
February 18, 2020 18:47
-
-
Save ademilter/aa5c2839650c7eff0797e6aa724575ab to your computer and use it in GitHub Desktop.
raster grid with gap
This file contains hidden or 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 Grid from './components/grid' | |
export default function Grid({ children, gap, ...props }) { | |
return ( | |
<Grid gap={32} col={4}> | |
<r-cell>cell</r-cell> | |
<r-cell>cell</r-cell> | |
<r-cell>cell</r-cell> | |
<r-cell>cell</r-cell> | |
</Grid> | |
) | |
} |
This file contains hidden or 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
r-grid { | |
--grid-tc: repeat(4, 1fr); | |
--grid-cs: 1; /* column start */ | |
--grid-ce: -1; /* column end */ | |
--grid-gap: 0; | |
display: grid; | |
grid-template-columns: var(--grid-tc); | |
grid-gap: var(--grid-gap); | |
} | |
/* | |
raster other styless... | |
*/ |
This file contains hidden or 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
export default function Grid({ children, gap, ...props }) { | |
return ( | |
<r-grid style={gap ? { '--grid-gap': `${gap}px` } : null} {...props}> | |
{children} | |
</r-grid> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment