Skip to content

Instantly share code, notes, and snippets.

@nichoth
Last active February 18, 2024 19:07
Show Gist options
  • Save nichoth/e523c4cb14643cab997343c5113483af to your computer and use it in GitHub Desktop.
Save nichoth/e523c4cb14643cab997343c5113483af to your computer and use it in GitHub Desktop.
Sets a max width, adds a consistent gutter and horizontally centers the contents
/*
via https://piccalil.li/quick-tip/use-css-clamp-to-create-a-more-flexible-wrapper-utility/
*/
/**
* WRAPPER
* Sets a max width, adds a consistent gutter and horizontally
* centers the contents
*/
.wrapper {
width: 90vw;
width: clamp(16rem, 90vw, 70rem);
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
position: relative;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment