Skip to content

Instantly share code, notes, and snippets.

@design-innovations
Created July 16, 2021 13:26
Show Gist options
  • Save design-innovations/aa7008bb9a1d24743e7d4739ecfa3807 to your computer and use it in GitHub Desktop.
Save design-innovations/aa7008bb9a1d24743e7d4739ecfa3807 to your computer and use it in GitHub Desktop.
CSS - Fab four
.fab-four {
--threshold: 600px;
--gap: 1rem;
--items: 3;
--gap-spacing: calc(var(--gap) * (var(--items) - 1));
display: flex;
flex-flow: row wrap;
gap: var(--gap);
}
.fab-four > * {
min-width: calc((100% - var(--gap-spacing)) / var(--items));
max-width: 100%;
width: calc((var(--threshold) - 100%) * 100000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment