Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

Smol Responsive CSS Grid

.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));
}
Source by smolcss.dev #
 
PREVIOUS NEXT
Tagged: #Smol #Responsive #CSS #Grid
ADD COMMENT
Topic
Name
9+6 =