Skip to content

Instantly share code, notes, and snippets.

@charliepark
Created December 25, 2020 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charliepark/fb0efb57658f19a23416cb7291016102 to your computer and use it in GitHub Desktop.
Save charliepark/fb0efb57658f19a23416cb7291016102 to your computer and use it in GitHub Desktop.
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