Skip to content

Instantly share code, notes, and snippets.

@scottkellum
Created May 14, 2021 17:41
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottkellum/bb46ea68c23e630842ee80c37513a3e6 to your computer and use it in GitHub Desktop.
Save scottkellum/bb46ea68c23e630842ee80c37513a3e6 to your computer and use it in GitHub Desktop.
html {
--max-width: 1200px;
--columns: 6;
--gutter: 1.5rem;
}
* {
--grid: minmax(var(--gutter), 1fr)
repeat(
var(--columns),
minmax(
0,
calc(
(var(--max-width) - (var(--gutter) * (var(--columns) - 1))) /
var(--columns)
)
)
)
minmax(var(--gutter), 1fr);
--subgrid: repeat(var(--columns), 1fr);
}
@media (min-width: 30em) {
html {
--columns: 12;
}
}
@media (min-width: 50em) {
html {
--columns: 24;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment