Last active
February 18, 2024 19:07
-
-
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
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
/* | |
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