.smol-css-grid { --min: 15ch; --gap: 1rem; display: grid; grid-gap: var(--gap); /* min() with 100% prevents overflow in extra narrow spaces */ grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min)), 1fr)); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter