Created
October 31, 2024 09:54
-
-
Save shiv19/b2578e815a3a02cc2d0054e6d48306f3 to your computer and use it in GitHub Desktop.
Fluid Columns Max3
This file contains 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
--max-columns: 3; | |
--min-column-width: 12rem; | |
--gap: 1rem; | |
/* Source: https://www.neatcss.dev/fluid-columns-max/ */ | |
.container { | |
display: grid; | |
grid-template-columns: | |
repeat( | |
auto-fit, | |
minmax( | |
min(100%, max(var(--min-column-width), 100%/var(--max-columns) - var(--gap))), | |
1fr)); | |
grid-gap: var(--gap); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment