Created
January 4, 2026 18:17
-
-
Save dz4k/ddd8daa59468bf6c33a620d7a10184d6 to your computer and use it in GitHub Desktop.
5 layout utilities that will handle 80% of cases
This file contains hidden or 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
| .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