Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to render a visual grid on-screen so you can play with spacing in your app
<div
id="grid"
style={{
backgroundSize: '8px 8px',
backgroundPosition: '50%',
backgroundImage:
'
linear-gradient(to right, hsla(0, 0%, 50%, 0.5) 1px, transparent 1px),
linear-gradient(to bottom, hsla(0, 0%, 50%, 0.5) 1px, transparent 1px)
',
position: 'fixed',
top: 0,
right: 0,
bottom: 0,
left: 0,
pointerEvents: 'none',
zIndex: 99999,
}}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment