Skip to content

Instantly share code, notes, and snippets.

@imaginamundo
Created November 9, 2023 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaginamundo/3f454bd5242ab13ddf95aa8a802f35e2 to your computer and use it in GitHub Desktop.
Save imaginamundo/3f454bd5242ab13ddf95aa8a802f35e2 to your computer and use it in GitHub Desktop.
A grid for content
.content-grid {
--padding: 1rem;
--content-max-width: 700px;
--breakout-max-width: 900px;
justify-items: center;
display: grid;
grid-auto-flow: row;
}
.content-grid > * {
box-sizing: border-box;
}
.content-grid > :not(img) {
width: 100%;
}
.content-grid > :not(.breakout, .full-width) {
max-width: min(var(--content-max-width), 100%);
padding-inline: var(--padding);
background: yellow;
}
.content-grid > .breakout {
max-width: min(var(--breakout-max-width), 100%);
padding-inline: var(--padding);
background: blue;
}
.content-grid > .full-width {
width: 100%;
background: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment