Last active
June 15, 2024 19:03
-
-
Save jlogix/691cf26381e914e18482e2de08b98037 to your computer and use it in GitHub Desktop.
This file contains 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
body{ | |
margin: 0; | |
} | |
.grid { | |
display: grid; | |
/* # of grid rows. This will be set by JS */ | |
grid-template-rows: var(--grid-rows); | |
/* # of grid columns. This will be set by JS */ | |
grid-template-columns: var(--grid-cols); | |
grid-row-gap: 5px; | |
grid-column-gap: 5px; | |
max-width: 1200px; | |
height: 100vh; | |
margin: 0 auto; | |
} | |
.grid div { | |
/* Variables for start row, start column, height, and width. Will be set by JS */ | |
grid-area: var(--row) / var(--col) / span var(--hgt) / span var(--wid); | |
background-color: var(--bg-color); | |
text-align: center; | |
/* for vertically centering the text inside the box. nrows = total # of grid rows */ | |
line-height: calc(var(--hgt) / var(--nrows) * 100vh); | |
color: #860ef5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment