Skip to content

Instantly share code, notes, and snippets.

@karlazz
Last active April 22, 2021 23:55
Show Gist options
  • Save karlazz/0f6ff048eb350857fed6b5e01673fd67 to your computer and use it in GitHub Desktop.
Save karlazz/0f6ff048eb350857fed6b5e01673fd67 to your computer and use it in GitHub Desktop.
Automated reponsive grid from Heydon Pickering and further grid notes
.container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
grid-gap: 1rem;
}
@karlazz
Copy link
Author

karlazz commented Apr 22, 2021

And here is a CSS trick with @supports for incompatible browsers for Grid feature:
.main {
width: 100%;
overflow: hidden;
}
.main > div {
width: 30%;
float: left;
}

@supports (display: grid) {
.main {
display: grid;
}
}

@karlazz
Copy link
Author

karlazz commented Apr 22, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment