Skip to content

Instantly share code, notes, and snippets.

@dz4k
Created January 4, 2026 18:17
Show Gist options
  • Select an option

  • Save dz4k/ddd8daa59468bf6c33a620d7a10184d6 to your computer and use it in GitHub Desktop.

Select an option

Save dz4k/ddd8daa59468bf6c33a620d7a10184d6 to your computer and use it in GitHub Desktop.
5 layout utilities that will handle 80% of cases
.x-container {
max-width: var(--length-l);
margin-inline: auto;
padding-inline: var(--gap-l);
.x-container {
padding-inline: 0;
}
@media (--small) {
padding-inline: var(--gap-m);
}
}
.layout-grid {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr;
gap: var(--gap-m);
@media (--width-s) {
display: flex;
flex-flow: column;
}
}
.flow-grid {
display: grid;
--length-cell: var(--length-card);
grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--length-cell)), 1fr));
gap: var(--gap-m);
}
.flex-column, .flex-row {
display: flex;
gap: var(--gap-m);
}
.flex-column {
flex-flow: column;
}
.flex-row {
flex-flow: row;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment